-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Prevent clear auth data when getSession error #763
Comments
I'm having the same problem with For example, when the user disconnects their Wifi and periodic refresh is turned on, with the first failed request, the user is logged out because the token data is removed from the state. The tokens should only be removed in three cases imo:
|
Hi @mbellamyy and @nvthuong1996 👋 I added the |
hello @phoenix-ru @zoey-kaiser ! has any update for this issue ? |
Hi @nvthuong1996 👋 We are currently focusing on finishing up the documentation rewrites, which is why we are currently less actively pushing forward discussions on new issues. Once we have the docs deployed we will revisit this issue (should be pretty soon). |
Some updates for this error ? |
It would be nice if the
I made a workaround using the
|
I have a similar issue (described in detail in #998). The workaround you mentioned doesn't appear to fix the issue I've described, does it? Do you know any solution for my issue? |
As a suggestion: It would be nice if we could pass a custom nuxt-auth/src/runtime/composables/local/useAuth.ts Lines 143 to 151 in 956b0fa
|
I created this PR (#999). I'm generally new to contributing to open-source projects, so forgive me if I've made any mistakes in the PR. I deliberately left the PR as minimal as possible to get feedback and of course, to see if the feature is actually a valid feature in your opinion. Update: Closed the PR for now because it doesn't work. Will reopen it when it works. |
Describe the feature
If getSession throws an exception, the backend is most likely at fault:
If you clear auth data, all users using the website will have to log in again.
nuxt-auth/src/runtime/composables/local/useAuth.ts
Line 99 in faa039b
How would you implement this?
Only clear the session when the http error code returned from the backend is 401
Additional information
Provider
The text was updated successfully, but these errors were encountered: