airmap-auth example page

showAuth()

Launches the Auth Modal when no valid access token is available.

logout(redirectUrl)

Logs out a user by removing the authenticated user token from localStorage and redirects the user (optional).

getUserId()

Retreives a user's id when authenticated. If no auth token exists or if it's invalid, the return value will be null.

getUserToken()

Retreives a user's token when one exists.

isAuthenticated()

Checks whether a user is authenticated, which means that they have a token and that the token is not expired.

Visit GitHub for more information including Documentation.