Comment on page
FrontendAuth
An implementation specific OpenID connect client.
interface OpenIDTokenSet {
access_token: string,
expires_at: number,
token_type?: 'Bearer',
id_token?: string,
refresh_token?: string
}
This function sets a refresh callback implementation for this object.
The
fn
argument must be a function that takes a refresh token (string) as an argument and returns a promise that contains an object that implements the OpenIDTokenSet
interface.import { IFrameRefresh } from '@vulos/identity-browser-sdk';
await auth.setRefreshTokenCallback(async function(refreshToken) {
console.log(this) // this is the auth object
if (refreshToken) {
// refresh using a refresh token
} else {
throw new Error('Not supported')
}
})
Last modified 1yr ago