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
refresh token with expired authorization token #924
Comments
Hi @HenriqueLimaUpp ! The But if there is no way to fix the endpoint, I recommend creating a custom sheme that extends the The built-in auto refresh feature was removed, but you can take a look a the code at #634 If you need help to make the auto refresh, just ping me. :) |
Custom scheme worked like a charm! Thank you very much, @JoaoPedroAS51 |
One last thing @JoaoPedroAS51 , although it worked great, i did override the login method for initialize auto refresh schedule when user sign in. It's there another way to add listener in to login request or call initializeScheduledRefresh method properly? |
I figout out there is a watchState method, that works great as well ;) |
Hi @HenriqueLimaUpp! When creating your custom scheme, import the import RefreshScheme from '~auth/schemes/refresh' Otherwise, you may get the error: Cannot use import statement outside a module I just updated #910, fixing the example. |
Can you share the code? |
nuxt.config.js
schemes/auto-refresh-token.js
|
I don't got this error, but i'm gonna fix the import. Thank you! |
@HenriqueLimaUpp @CavalcanteLeo Hey guys! Next release of This will be the new way to import schemes: import { RefreshScheme } from '~auth/runtime'
It was released right now: |
I updated to auth-next, but something weird is happening. After login, the page is not redirected, and even if i type the URL on browser, it goes to login page, and the cache is all set with the a valid token after login. @JoaoPedroAS51 |
@CavalcanteLeo Thank you for report! Can you open a new issue, with your config and if possible, a repro link? This would make it easier to understand what is happening :) |
Hi guys, i'm using v5 and facing a issue to get auto refresh token, because the request to get a new token is being sent when the authorization token is already expired, then i'm receiving status code 403 from response. What can i do on my client side to fix that?
The text was updated successfully, but these errors were encountered: