Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using netlifyIdentity.logout() does not clear the nf_jwt cookie. Site can still be accessed until cookie expiration. #502

Open
FODS-LLC opened this issue Dec 23, 2021 · 3 comments

Comments

@FODS-LLC
Copy link

Thank you for all the work you have put into building this identity tool. I have an observation about the netlifyIdentity.logout() function that I believe is a bug.

After logging in to the application using the widget, I end up with a cookie labeled nf_jwt and an entry in localStorage called gotrue.user and I can access the pages requiring permissions.

When I log out using netlifyIdentity.logout() function then the localStorage entry is cleared, but the cookie persists. I am able to navigate back to the protected pages.

I'm not sure if it is better to set the cookie expiration to a past time or delete the cookie on logout, but both seem to work for me.

@git-user-hub
Copy link

true

any improvements?

@mireille-raad
Copy link

I am trying to get netlifyIdentity.on('logout', () => console.log('Logged out')); to fire, so I can do some clean up work. It is not firing up.

Are there any workarounds for logout that we can work with?

@st3phhays
Copy link

I am now experiencing this issue, took me a while to figure out. Anyone have a workaround or plans to fix this? Seems this issue has been open for quite a while now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants