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:
Will Baumbach
2025-08-06 22:07:51 -05:00
parent fa0763df47
commit 1ce2d1583f
2 changed files with 11 additions and 3 deletions

View File

@@ -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&apos;t have an account?</Text>
<TouchableOpacity <TouchableOpacity
style={styles.signup} style={styles.signup}
onPress={() => { onPress={() => {

View File

@@ -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))
} }