-
Notifications
You must be signed in to change notification settings - Fork 42
Description
The signOut
method does not work as expected if the application is not using the authkit-nextjs middleware.
I am not using the auth middleware. Instead, I've created my own middleware using the authkit
(as supported in the authkit-nextjs docs). When I call the signOut
method, it successfully removes the wos-session
cookie, but it doesn't remotely logout of the WorkOS domain. As a result, the next time the user goes to the sign-in endpoint, it automatically logs them in because they're still signed in to the WorkOS domain.
This seems to be happening because the signOut
method uses withAuth
to get the Session ID, but I believe that withAuth
only works on routes that are using the authkit-nextjs middleware. As a result, it gets no Session ID and so doesn't ever attempt to logout remotely. It also doesn't throw any error or give any indication that it didn't find a Session ID.
Here are some possible solutions:
-
signOut
method can read the Session ID in some other way, so it doesn't rely on the middleware. -
authkit-nextjs can make expose a method that allows the user to manually delete the
wos-session
cookie. This would make it easier to build customer sign out flows.
Thank you!