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

Don't send token with login request #136

Closed
pedantic-git opened this issue Apr 11, 2018 · 4 comments
Closed

Don't send token with login request #136

pedantic-git opened this issue Apr 11, 2018 · 4 comments

Comments

@pedantic-git
Copy link
Contributor

What problem does this feature solve?

I currently have Nuxt hooked up to a Rails app with Devise-JWT handling authentication on the backend. It all works well apart from one thing:

When a token expires on the backend, I can't log in again from Nuxt.

The reason is that Nuxt sends the old token along with the login request, and Devise-JWT validates this before checking for the username and password.

What does the proposed changes look like?

I don't think it makes sense to ever send the token along with login requests, because the whole point of a login request is to issue a token. Can Nuxt just skip sending the token when the request is coming from the loginWith() method?

An alternative would be to always delete tokens completely from the store before login requests, and this is what I'm doing to work around this right now.

This feature request is available on Nuxt.js community (#c101)
@ghost ghost added the cmty:feature-request label Apr 11, 2018
@pi0
Copy link
Member

pi0 commented Apr 11, 2018

@pedantic-git I agree with unsettling token before loginWith. Please make a PR.

@pedantic-git
Copy link
Contributor Author

Hi @pi0 - I'm not particularly familiar with the internals of the auth-module. Would you recommend I do this in the core, or in the local scheme?

@pedantic-git
Copy link
Contributor Author

OK - I had a dig around and have proposed a solution in #151

@pi0 pi0 closed this as completed in b6cfad4 Apr 20, 2018
@pi0
Copy link
Member

pi0 commented Apr 20, 2018

Will be released soon.

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

No branches or pull requests

3 participants