diff --git a/auth0-js/auth0-js-tests.ts b/auth0-js/auth0-js-tests.ts index cbd791030b..cd7789c62d 100644 --- a/auth0-js/auth0-js-tests.ts +++ b/auth0-js/auth0-js-tests.ts @@ -61,8 +61,6 @@ webAuth.signupAndAuthorize({ }); - - webAuth.client.login({ realm: 'Username-Password-Authentication', //connection name or HRD domain username: 'info@auth0.com', @@ -73,6 +71,26 @@ webAuth.client.login({ // Auth tokens in the result or an error }); +webAuth.popup.buildPopupHandler(); +webAuth.popup.preload({}); +webAuth.popup.authorize({}, (err, data) => { + if (err) /* handle error */ return; + // do something with data +}); +webAuth.popup.loginWithCredentials({}, (err, data) => { + if (err) /* handle error */ return; + // do something with data +}); +webAuth.popup.passwordlessVerify({}, (err, data) => { + if (err) /* handle error */ return; + // do something with data +}); +webAuth.popup.signupAndLogin({}, (err, data) => { + if (err) /* handle error */ return; + // do something with data +}); + + let authentication = new auth0.Authentication({ domain: 'me.auth0.com', clientID: '...', @@ -101,7 +119,9 @@ authentication.delegation({ refresh_token: 'your_refresh_token', api_type: 'app' }, (err, data) => { - + if (!err) { + localStorage.setItem('token', data.idToken) + } }); authentication.loginWithDefaultDirectory({ @@ -146,6 +166,8 @@ let management = new auth0.Management({ management.getUser('asd', (err, user) => {}); -management.patchUserMetadata('asd', {role: 'admin'}, (err, user) => {}); +management.patchUserMetadata('asd', {role: 'admin'}, (err, user) => { + if (!err && user.email_verified) return; // do something +}); management.linkUser('asd', 'eqwe', (err, user) => {});