React SDK get token expire_in

Please include the following information in your post:

  • Which SDK this is regarding: React SDK
  • SDK Version: 1.10.2
  • Platform Version: JavaScript
  • Code Snippets/Error Messages/Supporting Details/Screenshots: Added
  "access_token": "eyJhbGciOxxxxxxxxxxxx",
  "id_token": "eyJhbGcixxxxxxxxxx",
  "scope": "openid profile email",
  "expires_in": 86400,
  "token_type": "Bearer"

above is the response I see in Browser Developer tools Network tab when invoked getAccessTokenSilently.

I’m trying to get the expires_in and use it to re-invoke getAccessTokenSilently if the token is expired.

    getAccessTokenSilently().then(( token ) => {
      console.log( token );

But getAccessTokenSilently is returning only the access_token but I want to get the expires_in as well.

Any workarounds are also welcome.