W
Wasp10mo ago
Jake

Auth kicking out

This could be a normal behavior but feels weird. Please let me know if I can ignore. I can demo this app with Chrome and Safari so this won't happen in front of the stakeholders. I have 2 pages. Campaign page (get-campaigns) need auth. Upload page (get-campaign-by-token) does not need auth. Both pages are opened in Safari in different tabs. If I switch between tabs I am getting logged out. After writing this it sounds normal? Does it? Here is the log: [ Server ] POST /auth/username/login 200 46.360 ms - 56 [ Server ] GET /auth/me 200 1.272 ms - 218 [ Server ] GET /auth/me 304 1.062 ms - - [ Server ] POST /operations/get-campaigns 200 1.545 ms - 1489 [ Server ] GET /auth/me 304 2.095 ms - - [ Server ] POST /operations/get-campaigns 200 3.050 ms - 1489 [ Server ] GET /auth/me 304 4.509 ms - - [ Server ] GET /auth/me 304 4.591 ms - - [ Server ] POST /operations/get-campaigns 200 5.334 ms - 1489 [ Server ] GET /auth/me 304 5.211 ms - - [ Server ] GET /auth/me 304 2.999 ms - - [ Server ] POST /operations/get-campaigns 200 2.729 ms - 1489 [ Server ] POST /operations/get-campaign-by-token 401 2.901 ms - 43 [ Server ] POST /operations/get-campaign-by-token 200 2.989 ms - 385 [ Server ] GET /auth/me 401 0.392 ms - 43 [ Server ] POST /operations/get-campaigns 401 0.680 ms - 14
4 Replies
miho
miho10mo ago
Tabs share localStorage that would explain if one of them hits a 401 error (even if some page doesn't need auth) we log you out and clear the localStorage for both.
[ Server ] POST /operations/get-campaign-by-token 401 2.901 ms -
In which page are you making this request? This maybe explain the log out behaviour i.e. you tried to do something for which you need auth, returned a 401 and then the system assumed the token is no longer valid.
Jake
JakeOP10mo ago
yes. related.
MEE6
MEE610mo ago
Wohooo @Jake, you just became a Waspeteer level 2!
Want results from more Discord servers?
Add your server