[auth0-js] Add optional usePostMessage for checkSession, fix travis-ci build error

This commit is contained in:
Adrian Chia
2017-12-05 17:03:16 -06:00
parent 2a41d4fb39
commit 1de5359aea
2 changed files with 16 additions and 2 deletions

View File

@@ -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',

View File

@@ -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<any>): void;
checkSession(options: CheckSessionOptions, callback: Auth0Callback<any>): 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;
}