-
-
Notifications
You must be signed in to change notification settings - Fork 177
Refresh provider on tab refocus calls getSession
instead of refresh
#765
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
Comments
@phoenix-ru Hey Phoenix sorry to ping, I see you started working on a PR regarding this, is this something you are still working on? I am facing a similar issue as above and I believe your PR would fix that issue :) I am sadly not experienced enough to figure out if I could help with anything in your PR, as I can barely understand what's going on :D |
Hi @ThomasSimonsen20 , I was on a vacation 🙂 |
Thank you for the update, hope you had a nice vacation :) |
…esh provider refreshing (#766) Co-authored-by: Zoey <[email protected]>
Hi @mbellamyy and @ThomasSimonsen20 👋 Sorry for the ping, but I wanted to quickly let you know that we have just released https://github.com./sidebase/nuxt-auth/releases/tag/0.8.0-alpha.3 in which you can now define your own custom refresh logic! Feel free to check out the release notes for more information! |
Environment
Reproduction
not needed, code is obvious
Describe the bug
This is actually two issues.
First issue is here. Let's assume
refresh
provider is chosen.nuxt-auth/src/runtime/utils/refreshHandler.ts
Lines 43 to 62 in faa039b
We're creating two intervals. One of them is calling
getSession
and the other is callingrefresh
. But therefresh
implementation callsgetSession
at the end itself... So the first interval might be redundant for refresh? I know the interval times are different. So this is not a hugely imporant part of this issue.Now the second (and more important) part of the issue:
nuxt-auth/src/runtime/utils/refreshHandler.ts
Lines 22 to 29 in faa039b
This function is the tab refocus refresher. It is calling
getSession
which is acceptable in thelocal
provider, but forrefresh
I think it should callrefresh
, which in turn callsgetSession
later.If the token is expired (but can be refreshed), this method is missing it and logging the user out.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: