FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    getting user object when getting new access token with refresh token

    Scheduled Pinned Locked Moved
    General Discussion
    2
    2
    389
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      nicholas.tsaoucis
      last edited by

      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 the POST /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)

      danD 1 Reply Last reply Reply Quote 0
      • danD
        dan @nicholas.tsaoucis
        last edited by

        @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.

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • First post
          Last post