mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
added a little more testing code
This commit is contained in:
parent
ad56ca57ea
commit
3a6cc84ded
@ -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) => {});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user