https://supertokens.com/ logo
c

CaptainPhoton

07/05/2022, 8:40 AM
There seems to be an issue with signing out. After calling the signOut() method, I cannot access the /login path as it just redirects me back to the / path
So it seems like it thinks I have a session
r

rp

07/05/2022, 8:40 AM
Hey! Can you send the debug logs for frontend and backend when you call ther sign out function?
c

CaptainPhoton

07/05/2022, 8:41 AM
it doesn't log anything afaik
lemme try again
I am doing this after deleting the user. I also revoke the session in the backend
maybe an edge case?
I have to remove cookies to be able to access the auth path again
r

rp

07/05/2022, 8:42 AM
There should be debug logs for sure. Pleas enable them if not
c

CaptainPhoton

07/05/2022, 8:45 AM
alright I'll try
r

rp

07/05/2022, 8:45 AM
cool
see the docs. There is a troubleshooting section
c

CaptainPhoton

07/05/2022, 8:47 AM
yeah found it! one sec
If I log out without deleting the user it works as expected
r

rp

07/05/2022, 8:47 AM
hmm.
c

CaptainPhoton

07/05/2022, 8:53 AM
Okay, here's the logs from the moment I deleted the user until I tried to visit /login again and it sent me to the / path
r

rp

07/05/2022, 8:55 AM
and the backend logs?
c

CaptainPhoton

07/05/2022, 8:56 AM
here
backend logs are from when I started the server with debugging on
r

rp

07/05/2022, 8:57 AM
oh right.. i see the problem now.
Can you open an issue about this?
c

CaptainPhoton

07/05/2022, 8:57 AM
sure!
r

rp

07/05/2022, 8:57 AM
Will fix it in the next release.
c

CaptainPhoton

07/05/2022, 8:58 AM
cool, thanks! Any workarounds I can do in the meantime?
also, should I open the issue in the node SDK or react SDK?
I'll just put it in the react lib
r

rp

07/05/2022, 9:03 AM
uhmm. About the workaround, you can override the signout API in the session.init and throw an unauthorised error like this:
Copy code
Session.init({
    override: {
        apis: (oI) => {
            return {
                ...oI,
                signOutPOST: async function (input) {
                    let resp = await oI.signOutPOST!(input);
                    if (resp.status === "OK") {
                        throw new Session.Error({
                            message: "Sign out",
                            type: "UNAUTHORISED",
                        })
                    }
                    return resp;
                }
            }
        }
    }
})
And please open in node repo
c

CaptainPhoton

07/05/2022, 9:04 AM
okay thanks! 😄
r

rp

07/05/2022, 9:04 AM
lmk if the above solution works
c

CaptainPhoton

07/05/2022, 9:04 AM
yes! Opening the issue first
r

rp

07/05/2022, 9:04 AM
ok thanks
good catch btw!
c

CaptainPhoton

07/05/2022, 9:05 AM
😄 yeah, the integration is mostly done so now there's only edge cases to smooth out
r

rp

07/05/2022, 9:05 AM
nice!
c

CaptainPhoton

07/05/2022, 9:06 AM
we went live with it yesterday, but deleting the user is not a blocker for prod so I'm doing it now
r

rp

07/05/2022, 9:06 AM
cool
r

rp

07/05/2022, 9:15 AM
thanks!
c

CaptainPhoton

07/05/2022, 9:18 AM
It works! thanks
r

rp

07/05/2022, 9:19 AM
great.
Hey! We have fixed this and released a new supertokens-node version -> 11.0.0. Please try it out. It is a breaking change since the previous version, so be sure to checkout the changelog
c

CaptainPhoton

07/05/2022, 3:22 PM
ok thanks! Will do soon
The new version works! The speed of these fixes is epic, thanks 😄
r

rp

07/05/2022, 6:00 PM
thanks!
2 Views