https://supertokens.com/ logo
Title
i

inmesh

11/28/2022, 1:45 PM
Hi 🙂 I use supertokens sign in for my app - I have a website for the sign in and the app opens it in the browser and redirect back to the app after login is successful. When I'm logged in in the browser but signed out in the app, I click sign in the app, I get to my sign in website and then get redirected automatically back to the app. My question is, what exactly happens on the automatic redirect? because sometimes the auto-redirect gets stuck in the middle but I'm having a hard time debugging this.
r

rp

11/28/2022, 1:46 PM
hey @inmesh
> what exactly happens on the automatic redirect? Basically, then sign in UI checks if a session already exists (which it will in the browser) and then redirects back to where you specify.
If you want the app logout to also logout of the browser session, you could: - Modify the app logout API to clear all sessions of that user. And modify the webapp to first call some API on the backend to check if the session exists, and if it doesn't, clear cookies using the
session.revokeSession
function on the backend. This will now make the frontend not redirect anymorel; OR - Somehow manually clear all cookies in the browser that's opened by the app when logout is called from the app.
i

inmesh

11/28/2022, 2:18 PM
It will solve my problem only partially - forgot to mention another scenario is when I'm logged in the web and only then download the app, so the logout isn't relevant in this case. I suspect it gets stuck only when the sAccessToken is missing (if I'm logged in the web for a few hours)
r

rp

11/28/2022, 2:20 PM
in that case, the web browser would do a session refresh yielding a new access token anyway.
if the frontend on the web app doesn't do that, then you might wanna see why. It should be refreshing if you are using our frontend SDK on the web
i

inmesh

11/28/2022, 2:36 PM
I'll check that, thanks
r

rp

11/28/2022, 2:50 PM
alright