const { isAuthenticated } = useConvexAuth();
React.useEffect(() => {
console.log('isAuthenticated', isAuthenticated);
}, [isAuthenticated]);
const onSubmit = async (data: AuthFormType) => {
setIsSubmitting(true);
signIn(data.provider, data.params).catch((error) => {
console.error(error);
let toastTitle: string;
if (error instanceof ConvexError && error.data === 'INVALID_PASSWORD') {
toastTitle = 'Invalid password - check the requirements and try again.';
} else {
toastTitle =
flow === 'signIn'
? 'Could not sign in, did you mean to sign up?'
: 'Could not sign up, did you mean to sign in?';
}
showMessage({
message: toastTitle,
type: 'danger',
});
setIsSubmitting(false);
});
};
const { isAuthenticated } = useConvexAuth();
React.useEffect(() => {
console.log('isAuthenticated', isAuthenticated);
}, [isAuthenticated]);
const onSubmit = async (data: AuthFormType) => {
setIsSubmitting(true);
signIn(data.provider, data.params).catch((error) => {
console.error(error);
let toastTitle: string;
if (error instanceof ConvexError && error.data === 'INVALID_PASSWORD') {
toastTitle = 'Invalid password - check the requirements and try again.';
} else {
toastTitle =
flow === 'signIn'
? 'Could not sign in, did you mean to sign up?'
: 'Could not sign up, did you mean to sign in?';
}
showMessage({
message: toastTitle,
type: 'danger',
});
setIsSubmitting(false);
});
};