diff --git a/types/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts index a4650c6154..d05ee2251e 100644 --- a/types/auth0-js/auth0-js-tests.ts +++ b/types/auth0-js/auth0-js-tests.ts @@ -182,7 +182,14 @@ webAuth.checkSession({ // Authentication tokens or error }); - +webAuth.checkSession({ + audience: 'https://mystore.com/api/v2', + scope: 'read:order write:order', + redirectUri: 'https://example.com/auth/silent-callback', + usePostMessage: true + }, (err, authResult) => { + // Renewed tokens or error +}); const authentication = new auth0.Authentication({ domain: 'me.auth0.com', diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index 7bce828ac1..6110f2fe52 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -275,7 +275,7 @@ export class WebAuth { * @param options options used in {@link authorize} call * @param callback: any(err, token_payload) */ - checkSession(options: AuthorizeOptions, callback: Auth0Callback): void; + checkSession(options: CheckSessionOptions, callback: Auth0Callback): void; } export class Redirect { @@ -761,3 +761,10 @@ export interface AuthorizeOptions { scope?: string; audience?: string; } + +export interface CheckSessionOptions extends AuthorizeOptions { + /** + * optional parameter for auth0 to use postMessage to communicate between the silent callback and the SPA. + */ + usePostMessage?: boolean; +}