How to determine authentication status?

  • 1
  • Question
  • Updated 3 years ago
  • Answered
  • (Edited)

To check authentication status:

platform.isAuthorized()
    .then(function(){ ... })
    .catch(function(e){ ... });
The isAuthorized method will automatically perform a refresh of the access token, if needed. This method may be used in the login page of your application for automatic login.

There is also a synchronous method for checking the authentication status that does not automatically perform a refresh of the access token.

if (platform.isTokenValid()) {...}

Access token refresh normally happens automatically for common use cases. On rare occasions, you may perform a refresh of the access token manually by calling the refresh method, as follows:

platform.refresh().then(...)
Photo of TT

TT, Alum

  • 412 Points 250 badge 2x thumb

Posted 3 years ago

  • 1

Be the first to post a reply!