diff --git a/types/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts index 6d21de4ed3..6353cc1e40 100644 --- a/types/auth0-js/auth0-js-tests.ts +++ b/types/auth0-js/auth0-js-tests.ts @@ -136,6 +136,12 @@ webAuth.passwordlessStart({ send: 'code' }, (err, data) => {}); +webAuth.passwordlessLogin({ + connection: 'the_connection', + phoneNumber: '123', + verificationCode: '456' +}, (err, data) => {}); + webAuth.signupAndAuthorize({ connection: 'the_connection', email: 'me@example.com', diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index 7ca266e6ce..a38c928333 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -270,6 +270,13 @@ export class WebAuth { */ passwordlessVerify(options: PasswordlessVerifyOptions, callback: Auth0Callback): void; + /** + * Logs in a user with the verification code sent to the user + * @param options + * @param callback + */ + passwordlessLogin(options: PasswordlessLoginOptions, callback: Auth0Callback): void; + /** * Renews an existing session on Auth0's servers using `response_mode=web_message` (i.e. Auth0's hosted login page) * @@ -615,6 +622,13 @@ export interface PasswordlessVerifyOptions { send?: string; } +export interface PasswordlessLoginOptions { + connection: string; + verificationCode: string; + phoneNumber?: string; + email?: string; +} + export interface Auth0UserProfile { name: string; nickname: string;