Hi 👋 following up on #98, which was resolved (thank you!). After upgrading to the latest version of @workos/authkit-js, we’re seeing unexpected behavior in our logout/login flow.
Summary
After calling signOut(), the user is redirected back to our app as expected. On page load, the user is not authenticated. However, when our app calls signIn(), the user is immediately logged in, without seeing a login prompt or taking any explicit action.
Reverting to the previous version of authkkit-js restores the expected behavior, with no code changes on our end.
Expected behavior
client.signOut({ returnTo }) redirects back to the app
client.getUser() indicates the user is not authenticated
- Calling
client.signIn() shows the login UI
- User must authenticate before being logged in
Actual behavior (latest version)
signOut() redirects back to the app
client.getUser() indicates the user is not authenticated
- App calls
client.signIn()
- User is immediately logged in, without seeing a login prompt
Relevant code
Auth gate on load:
const isAuthenticated = await client.getUser();
if (!isAuthenticated) {
client.signIn({ state: path }); // this happens after a logout
} else {
runApp();
}
xref: https://github.com/RoundingWell/care-ops-frontend/blob/develop/packages/care-ops-auth/providers/workos.js
No changes were made to this logic between versions.
Notes / Observations
This behavior did not occur before the fix for #98
Redirect works, but authentication state appears to persist
Happy to test a patch or provide a minimal repro if helpful.
Thanks!
Hi 👋 following up on #98, which was resolved (thank you!). After upgrading to the latest version of
@workos/authkit-js, we’re seeing unexpected behavior in our logout/login flow.Summary
After calling
signOut(), the user is redirected back to our app as expected. On page load, the user is not authenticated. However, when our app callssignIn(), the user is immediately logged in, without seeing a login prompt or taking any explicit action.Reverting to the previous version of authkkit-js restores the expected behavior, with no code changes on our end.
Expected behavior
client.signOut({ returnTo })redirects back to the appclient.getUser()indicates the user is not authenticatedclient.signIn()shows the login UIActual behavior (latest version)
signOut()redirects back to the appclient.getUser()indicates the user is not authenticatedclient.signIn()Relevant code
Auth gate on load:
xref: https://github.com/RoundingWell/care-ops-frontend/blob/develop/packages/care-ops-auth/providers/workos.js
No changes were made to this logic between versions.
Notes / Observations
This behavior did not occur before the fix for #98
Redirect works, but authentication state appears to persist
Happy to test a patch or provide a minimal repro if helpful.
Thanks!