You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I having trouble to understand the integration of the "refresh" scheme in auth-next. For now I have a login flow working and the refresh_token is also stored in localState. I can receive a new token with "this.$auth.refreshTokens()".
My refresh token endpoint is not protected with the access_token so I think I do not need something like suggested here: #924
Now I would like to achieve this:
If the access_token is expired but the refresh_token is not, auth should ask the refresh endpoint for a new access_token and do not sign the user off.
So you can be still loged on if you open the page one day later for example.
But when the access_token is expired, auth do not call the refresh api and I simply get logged of.
With the suggestions of the above issue I created a custom scheme with following code:
My idea is that if the acces_token is expired and the refresh_token is not I call the handleRefresh() function. Sometimes this seems to be working, but it is not very robust as it messed up some tokens from time to time.
So my question would be if there is some sort of other method I am simply missing like an option in the module configuration. Or maybe a good way to try to get a new access_token before signing off because of acces_token expiration.
Hi @JoaoPedroAS51,
wow thank you sooo much! I must have missed or misundersood that one line in the explanation of autoLogout.
Now it works like a charm. I simply switched it to false and the scheme back to default "refresh".
Thanks again!
Maybe it would make sense if we could make that notice a little more prominent in the Docs because it is a crucial part of getting refresh working (even if "autoLogout" is false by default)
Hello, i'm facing the same issue, i even put autoLogout: false, but still when my access token expires refresh token doesn't get the new token automatically.
Hi all :)
I having trouble to understand the integration of the "refresh" scheme in auth-next. For now I have a login flow working and the refresh_token is also stored in localState. I can receive a new token with "this.$auth.refreshTokens()".
My refresh token endpoint is not protected with the access_token so I think I do not need something like suggested here: #924
Now I would like to achieve this:
If the access_token is expired but the refresh_token is not, auth should ask the refresh endpoint for a new access_token and do not sign the user off.
So you can be still loged on if you open the page one day later for example.
But when the access_token is expired, auth do not call the refresh api and I simply get logged of.
With the suggestions of the above issue I created a custom scheme with following code:
My idea is that if the acces_token is expired and the refresh_token is not I call the handleRefresh() function. Sometimes this seems to be working, but it is not very robust as it messed up some tokens from time to time.
So my question would be if there is some sort of other method I am simply missing like an option in the module configuration. Or maybe a good way to try to get a new access_token before signing off because of acces_token expiration.
My config looks like:
Thanks a lot!
The text was updated successfully, but these errors were encountered: