From eb04a7c5cc88943dc912607ba2be32ebcf89494a Mon Sep 17 00:00:00 2001 From: Adrian Chia Date: Tue, 5 Dec 2017 16:33:15 -0600 Subject: [PATCH] Add checkSession method to acquire new token from Auth0 --- types/auth0-js/auth0-js-tests.ts | 10 ++++++++++ types/auth0-js/index.d.ts | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/types/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts index d425cca21a..a4650c6154 100644 --- a/types/auth0-js/auth0-js-tests.ts +++ b/types/auth0-js/auth0-js-tests.ts @@ -174,6 +174,16 @@ webAuth.login({username: 'bar', password: 'foo'}, (err, data) => {}); webAuth.crossOriginAuthenticationCallback(); +webAuth.checkSession({ + audience: 'https://mystore.com/api/v2', + scope: 'read:order write:order', + redirectUri: 'https://example.com/auth/silent-callback' + }, (err, authResult) => { + // Authentication tokens or error +}); + + + const authentication = new auth0.Authentication({ domain: 'me.auth0.com', clientID: '...', diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index 340f14e15b..443ba7674b 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -268,6 +268,14 @@ export class WebAuth { * @param options: */ passwordlessVerify(options: PasswordlessVerifyOptions, callback: Auth0Callback): void; + + /** + * Renews an existing session on Auth0's servers using `response_mode=web_message` (i.e. Auth0's hosted login page) + * + * @param options options used in {@link authorize} call + * @param callback + */ + checkSession(options: AuthorizeOptions, callback: Auth0Callback): void; } export class Redirect {