atomic-server
atomic-server copied to clipboard
Refreshing page on private resource shows "unauthorized resource"
- Open chrome / arc
- Go to staging.atomicdata.dev
- Create a new drive
- Refresh
Unauthorized resource
- This problem doesn't occur in
localhost - This problem doesn't occur in non-chromium browsers (firefox or safari)
- I suspect that the
store.setAgentis called while the Resource isloading - I saw that there was no Auth message in the
/wscalls, which led tounauthorizedresources
Fix didn't work
I noticed that there was no AUTH message in the /ws hooks
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);
}
}
}
}
I think the issue is resolved now... At least
It's still here in some cases..! The e2e.spec still has a failing test