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/refresh
to 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)
-
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.