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

Auth module and vuex persist: are they incompatible? #471

Closed
Alagaesia93 opened this issue Oct 23, 2019 · 1 comment
Closed

Auth module and vuex persist: are they incompatible? #471

Alagaesia93 opened this issue Oct 23, 2019 · 1 comment
Labels

Comments

@Alagaesia93
Copy link

Alagaesia93 commented Oct 23, 2019

Btw, the plugin will be conflict a little bit with some vuex persist plugin. Please update the doc to tell people do not include auth module when they use vuex-persist plugin or localStorage to store vuex state.

Originally posted by @8bu in #134 (comment)

I have a Nuxt app with Rails backend, Devise takes care of authentication.
I want to let my user register and login at the same time

This is my working code (found in some issues)

this.$auth.setToken(this.$store.state.auth.strategy, token)
this.$auth.strategy._setToken(token)
this.$auth.fetchUser()

When I install vuex-persist, both with and without reducer, I can't make it work anymore. The test behaviour is that when I want to navigate to a page with auth true it redirects me to /login. Then I can go back to the previous logged in page, without log in.

Has anybody had a similar experience and solved the issue?

This question is available on Nuxt community (#c434)
@ghost ghost closed this as completed Oct 23, 2019
@ghost ghost added the cmty:question label Oct 23, 2019
@ghost
Copy link

ghost commented Oct 23, 2019

This issue as been imported as question since it does not respect auth-module issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/auth-module/issues/c434.

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

No branches or pull requests

2 participants