const handleEmailLogin = async () => {
try {
const user = await authClient.signIn.email(
{
email,
password,
},
{
onError(ctx) {
console.log('Email Sign-In Error:', ctx.error);
},
},
);
console.log('User:', user);
router.replace('/home');
} catch (error: any) {
console.error('Email Sign-In Error:', error);
Alert.alert(
'Sign In Failed',
error.message || 'An error occurred during sign in.',
);
}
};
const handleEmailLogin = async () => {
try {
const user = await authClient.signIn.email(
{
email,
password,
},
{
onError(ctx) {
console.log('Email Sign-In Error:', ctx.error);
},
},
);
console.log('User:', user);
router.replace('/home');
} catch (error: any) {
console.error('Email Sign-In Error:', error);
Alert.alert(
'Sign In Failed',
error.message || 'An error occurred during sign in.',
);
}
};