atomic-server icon indicating copy to clipboard operation
atomic-server copied to clipboard

Refreshing page on private resource shows "unauthorized resource"

Open joepio opened this issue 2 years ago • 5 comments

  1. Open chrome / arc
  2. Go to staging.atomicdata.dev
  3. Create a new drive
  4. Refresh
  5. Unauthorized resource
Screenshot 2023-11-02 at 15 16 12
  • This problem doesn't occur in localhost
  • This problem doesn't occur in non-chromium browsers (firefox or safari)
  • I suspect that the store.setAgent is called while the Resource is loading
  • I saw that there was no Auth message in the /ws calls, which led to unauthorized resources

joepio avatar Nov 02 '23 14:11 joepio

Fix didn't work

joepio avatar Nov 07 '23 13:11 joepio

I noticed that there was no AUTH message in the /ws hooks

joepio avatar Dec 12 '23 10:12 joepio

I just removed the ga cookies from staging.atomicdata.dev locally, and that also resolved the issue.

We had that bug earlier, but I fixed it. This is really weird, because I specifically test for this in irrelevant_cookie, and the test passes.

I was also able to get an unauthorized error by logging in to atomicdata.dev and after that logging in to staging.atomicdat.dev. This resulted in two cookies, which seem to conflict... The thing is, we also have a fix and test for that!


    for enc in encoded_session_cookies {
        match get_auth_from_base64(&enc, requested_subject) {
            Ok(auth_vals) => return Ok(Some(auth_vals)),
            Err(e) => {
                if e.message.contains(WRONG_SUBJECT_ERR) && check_multiple {
                    // if the subject is wrong, we can try the next one
                    err = e;
                    continue;
                } else {
                    return Err(e);
                }
            }
        }
    }

joepio avatar Dec 12 '23 11:12 joepio

I think the issue is resolved now... At least

joepio avatar Dec 12 '23 17:12 joepio

It's still here in some cases..! The e2e.spec still has a failing test

joepio avatar Jan 03 '24 12:01 joepio