Implement and provide a custom TokenStore class for token get, set and clear operations.
Overview
By default PassageJS will store, lookup and clear auth tokens in localstorage and in a cookie using a consistent key value. By defining your own TokenStore as a config option for PassageJS you can:
Store and retrieve your tokens in the method best for your use case
Have PassageJS use a non-passage JWT (see Authorizers)
Given an auth response on login completion you have the ability to set your token(s) via any storage mechanism (asynchronous or synchronous). It should return a promise.
authResult
interfaceAuthResult { redirect_url:string; auth_token:string; refresh_token:string; // if refresh tokens are enabled refresh_token_expiration:number; // if refresh tokens are enabled}
Returns a promise containing the refresh token value for PassageJS to use. This will be used silently behind the scenes when making authenticated requests. See Refresh Tokens for more details.