Update auth0-lock to v10.9.1 API

This commit is contained in:
Brian Caruso
2017-01-10 10:37:40 -08:00
parent d22bd22f74
commit 24906647e6
2 changed files with 48 additions and 4 deletions
+25 -1
View File
@@ -1,5 +1,5 @@
/// <reference types="auth0-js" />
/// <reference path="index.d.ts" />
const CLIENT_ID = "YOUR_AUTH0_APP_CLIENTID";
const DOMAIN = "YOUR_DOMAIN_AT.auth0.com";
@@ -10,6 +10,30 @@ lock.show();
lock.hide();
lock.logout(() => {});
// Show supports UI arguments
var showOptions : Auth0LockShowOptions = {
allowedConnections: [ "twitter", "facebook" ],
autoclose: false,
autofocus: true,
closable: true,
container: "somediv",
flashMessage: {
type: "error",
text: "an error has occurred"
},
language: "en",
popupOptions: {
width: 100,
height: 400,
left: 200,
top: 200
},
rememberLastLogin: false
};
lock.show(showOptions);
// The examples below are lifted from auth0-lock documentation on Github
// "on" event-driven example
+23 -3
View File
@@ -1,4 +1,4 @@
// Type definitions for auth0-lock v10.0.1
// Type definitions for auth0-lock v10.9.1
// Project: http://auth0.com
// Definitions by: Brian Caruso <https://github.com/carusology>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -103,13 +103,33 @@ interface Auth0LockConstructorOptions {
usernameStyle?: string;
}
interface Auth0LockFlashMessageOptions {
type: "success" | "error",
text: string;
}
interface Auth0LockShowOptions {
allowedConnections?: string[];
autoclose?: boolean;
autofocus?: boolean;
avatar?: Auth0LockAvatarOptions;
closable?: boolean;
container?: string;
flashMessage?: Auth0LockFlashMessageOptions;
language?: string;
languageDictionary?: any;
popupOptions?: Auth0LockPopupOptions;
rememberLastLogin?: boolean;
}
interface Auth0LockStatic {
new (clientId: string, domain: string, options?: Auth0LockConstructorOptions): Auth0LockStatic;
getProfile(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void) : void;
// deprecated
getProfile(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void) : void;
getUserInfo(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void) : void;
show(): void;
show(options?: Auth0LockShowOptions): void;
hide(): void;
logout(query: any): void;