mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
Update auth0-lock to v10.9.1 API
This commit is contained in:
@@ -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
|
||||
|
||||
Vendored
+23
-3
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user