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>
|
<Text style={{ color: '#fff', fontWeight: 'bold' }}>Login</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<Text style={styles.textCenter}>Don't have an account?</Text>
|
<Text style={styles.textCenter}>Don't have an account?</Text>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.signup}
|
style={styles.signup}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
|
|||||||
@@ -15,17 +15,25 @@ export default function SignUpScreen() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Start Auth
|
// Start Auth
|
||||||
await signUp.create({
|
const signUpAttempt = await signUp.create({
|
||||||
firstName: fname,
|
firstName: fname,
|
||||||
lastName: lname,
|
lastName: lname,
|
||||||
emailAddress: email,
|
emailAddress: email,
|
||||||
password
|
password
|
||||||
})
|
})
|
||||||
|
|
||||||
// Set confirmation
|
// Set confirmation
|
||||||
await signUp.prepareEmailAddressVerification({
|
await signUp.prepareVerification({
|
||||||
strategy: 'email_link',
|
strategy: 'email_link',
|
||||||
redirectUrl: '/'
|
redirectUrl: '/'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (signUpAttempt.status === 'complete') {
|
||||||
|
setActive({ session: signUpAttempt.createdSessionId })
|
||||||
|
router.replace('/')
|
||||||
|
} else {
|
||||||
|
console.log(signUpAttempt)
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(JSON.stringify(e))
|
console.log(JSON.stringify(e))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user