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

Added support for logging out without an API endpoint #124

Merged
merged 1 commit into from Apr 6, 2018
Merged

Added support for logging out without an API endpoint #124

merged 1 commit into from Apr 6, 2018

Conversation

joostdecock
Copy link
Contributor

@joostdecock joostdecock commented Apr 6, 2018

This is a fix for
https://nuxtjs.cmty.io/nuxt-community/auth-module/issues/c90

Setting the logout strategy to false will effectively mean that
logout does nothing (it simple returns).

However, when you have a stateless API, and no need to call
a logout endpoint, you still want the user to be logged out
in the browser (token removed, session reset, that sort of stuff).

This change handles that by not returning if the logout option
is falsy, but instead only skipping over the networking part.

I think this is the behaviour people would expect when they set
logout to false.

This is a fix for
https://nuxtjs.cmty.io/nuxt-community/auth-module/issues/c90

Setting the `logout` strategy to `false` will effectively mean that
logout does nothing (it simple returns).

However, when you have a stateless API, and no need to call
a logout endpoint, you still want the user to be logged out
in the browser (token removed, session reset, that sort of stuff).

This change handles that by not returning if the logout option
is falsy, but instead only skipping over the networking part.

I think this is the behaviour people would expect when they set
logout to `false`.
pi0
pi0 approved these changes Apr 6, 2018
@pi0 pi0 merged commit 6189c6d into nuxt-community:dev Apr 6, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants