Basic authentication emailandpassword, refresh accessToken using refreshToken
I am using basic authentication, emailAndPassword, adn plugin jwt and OIDC provider. I want to refresh accessToken using refreshToken till refreshToken is valid
5 Replies
Not sure if i get what you mean. Access token fetched using better auth will be refreshed if expired automatically
What I mean is that accessToken when first user logs in it should refresh and generate new token if refreshToken is not expired. Are there any methods to get new access token when refresh token is not expired?
JWT | Better Auth
Authenticate users with JWT tokens in services that can't use the session
My current scenarios that i want to implement is that,
I want my current session to remain as it it, and just before token expires, new token should be generated and replace old token, this should continue till refresh token expires.
I am using emailAndPassword, with jwt, oidc provider, multisession plugins for auth flow. I am not using any providers to login
Check the link I sent
It explains how to get the token
Also better auth does the refresh internally so you don't need to worry about getting an expired tokenn