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

oauth2RefreshTest.vue in the demo app is broken #747

Closed
kevintechie opened this issue Jun 29, 2020 · 7 comments
Closed

oauth2RefreshTest.vue in the demo app is broken #747

kevintechie opened this issue Jun 29, 2020 · 7 comments

Comments

@kevintechie
Copy link
Contributor

kevintechie commented Jun 29, 2020

Version

v4.9.1

Reproduction link

https://github.com/nuxt-community/auth-module/blob/dev/demo/pages/oauth2RefreshTest.vue#L119

Steps to reproduce

  1. checkout latest dev branch and install dependencies
  2. launch the demo app
  3. login using oAuth2
  4. follow link to /oauth2RefreshTest
  5. see error messages "Cannot read property '_getExpiration' of undefined"

What is expected ?

I expect to access the page to test out oAuth2 token and refresh token functionality

What is actually happening?

I see error message. It appears that the this.$auth.token and refreshToken classes are undefined.

This bug report is available on Nuxt community (#c605)
@kevintechie
Copy link
Contributor Author

Is it now recommended to use the Storage class to get and update the tokens for this page? Will updating the tokens via the Storage also update the tokens passed by Axios?

@kevintechie
Copy link
Contributor Author

After some exploring, it looks like the token and refreshToken methods have moved to the strategy object. I might have a PR soon.

@kevintechie
Copy link
Contributor Author

@JoaoPedroAS51 can you confirm my findings about moving of the token and refreshToken methods?

@JoaoPedroAS51
Copy link
Collaborator

JoaoPedroAS51 commented Jul 1, 2020

Hi @kevintechie! Thank you for your report! :)

Yes, now the token and refreshToken instances are initialized inside scheme (strategy).

@JoaoPedroAS51
Copy link
Collaborator

Fixed in latest commit 😊

@kevintechie
Copy link
Contributor Author

Thanks, so much. Your commit looked exactly like the changes I made. Also, thanks for the quick response.

@jawa-the-hutt
Copy link

quick comment here as i'm under a deadline to get something shipped. The v5 docs for Tokens need updated to account for the added strategy path to the get/set functions.

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

3 participants