Created
September 8, 2022 17:32
-
-
Save leecrossley/5509997ab661fa6cc7785715cc9b1eb4 to your computer and use it in GitHub Desktop.
Auth0 passwordless example (react native)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auth0.auth | |
.passwordlessWithSMS({ | |
phoneNumber: "+447555555555", // validate input - format +44 | |
send: "code", | |
}) | |
.then(goToVerifyCode) | |
.catch(() => { | |
Alert.alert( | |
"We're sorry!", | |
"We couldn't send your code, please check your number and try again.", | |
); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auth0.auth | |
.loginWithSMS({ | |
phoneNumber: "+447555555555", // from earlier | |
code: "123456", // code input from sms | |
scope: "openid offline_access", // offline access required for refresh token | |
}) | |
.then(goToApp) | |
.catch(failLogin); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment