mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-29 08:58:23 +08:00
Add getUserInfo based on auth0-lock documentation on Github (#13823)
This commit is contained in:
@@ -26,6 +26,18 @@ lock.on("authenticated", function(authResult : any) {
|
||||
});
|
||||
});
|
||||
|
||||
lock.on("authenticated", function(authResult : any) {
|
||||
lock.getUserInfo(authResult.accessToken, function(error, profile) {
|
||||
if (error) {
|
||||
// Handle error
|
||||
return;
|
||||
}
|
||||
|
||||
localStorage.setItem("idToken", authResult.idToken);
|
||||
localStorage.setItem("profile", JSON.stringify(profile));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// test theme
|
||||
|
||||
|
||||
2
auth0-lock/index.d.ts
vendored
2
auth0-lock/index.d.ts
vendored
@@ -107,6 +107,8 @@ interface Auth0LockStatic {
|
||||
new (clientId: string, domain: string, options?: Auth0LockConstructorOptions): Auth0LockStatic;
|
||||
getProfile(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void) : void;
|
||||
|
||||
getUserInfo(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void) : void;
|
||||
|
||||
show(): void;
|
||||
hide(): void;
|
||||
logout(query: any): void;
|
||||
|
||||
Reference in New Issue
Block a user