getting user object when getting new access token with refresh token
-
we currently save the jwt returned after logging in between sessions and use it to allow the user to automatically log back in on its own.
We use thePOST /api/jwt/refreshto get a new access token when a user refreshes their page or has opted to "remember me" and allow the app to automatically log in on its own (as long as the saved jwt is valid)
The issue we are runing into though, is the login api provides the user object also, where as the refresh jwt does not.i Imagine i could just ofc call the retrieve/user api but i wanted to find out if im doing the wrong thing to start with and there is a better way to do what im trying to do (like something as simple as "login with jwt" or something like that)
-
@nicholas-tsaoucis
You could either store off the user object on first login (into a session or something similar) or call 'retrieve user' using the user API and presenting a JWT.
https://fusionauth.io/docs/v1/tech/apis/users#retrieve-a-user
I don't think you're doing anything wrong by doing so.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login