sign in and sign up flow working - sign up is a little janky i will probably switch to a code based verification
This commit is contained in:
@@ -48,7 +48,7 @@ export default function LoginScreen() {
|
||||
>
|
||||
<Text style={{ color: '#fff', fontWeight: 'bold' }}>Login</Text>
|
||||
</TouchableOpacity>
|
||||
<Text style={styles.textCenter}>Don't have an account?</Text>
|
||||
<Text style={styles.textCenter}>Don't have an account?</Text>
|
||||
<TouchableOpacity
|
||||
style={styles.signup}
|
||||
onPress={() => {
|
||||
|
||||
@@ -15,17 +15,25 @@ export default function SignUpScreen() {
|
||||
|
||||
try {
|
||||
// Start Auth
|
||||
await signUp.create({
|
||||
const signUpAttempt = await signUp.create({
|
||||
firstName: fname,
|
||||
lastName: lname,
|
||||
emailAddress: email,
|
||||
password
|
||||
})
|
||||
|
||||
// Set confirmation
|
||||
await signUp.prepareEmailAddressVerification({
|
||||
await signUp.prepareVerification({
|
||||
strategy: 'email_link',
|
||||
redirectUrl: '/'
|
||||
})
|
||||
|
||||
if (signUpAttempt.status === 'complete') {
|
||||
setActive({ session: signUpAttempt.createdSessionId })
|
||||
router.replace('/')
|
||||
} else {
|
||||
console.log(signUpAttempt)
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(JSON.stringify(e))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user