From 4ef390ef6e1cda3c2b5e1276b361bd39d0bee390 Mon Sep 17 00:00:00 2001 From: Sterling Camden Date: Fri, 8 Dec 2017 10:13:34 -0800 Subject: [PATCH] Update auth0-lock-tests.ts --- types/auth0-lock/auth0-lock-tests.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/types/auth0-lock/auth0-lock-tests.ts b/types/auth0-lock/auth0-lock-tests.ts index 0642453a13..c67afcb0c7 100644 --- a/types/auth0-lock/auth0-lock-tests.ts +++ b/types/auth0-lock/auth0-lock-tests.ts @@ -10,6 +10,17 @@ lock.show(); lock.hide(); lock.logout(() => {}); +lock.checkSession({}, function (error, authResult) { + if (error || !authResult) { + lock.show(); + } else { + // user has an active session, so we can use the accessToken directly. + lock.getUserInfo(authResult.accessToken, function (error, profile) { + console.log(error, profile); + }); + } +}); + // Show supports UI arguments const showOptions : Auth0LockShowOptions = {