type caught error to any
This commit is contained in:
@ -24,7 +24,7 @@ export const LoginForm = (props: LoginFormProps) => {
|
||||
try {
|
||||
await loginMutation(values);
|
||||
props.onSuccess?.();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
if (error instanceof AuthenticationError) {
|
||||
return { [FORM_ERROR]: "Sorry, those credentials are invalid" };
|
||||
} else {
|
||||
|
@ -24,7 +24,7 @@ export const SignupForm = (props: SignupFormProps) => {
|
||||
try {
|
||||
await signupMutation(values);
|
||||
props.onSuccess?.();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
if (error.code === "P2002" && error.meta?.target?.includes("email")) {
|
||||
// This error comes from Prisma
|
||||
return { email: "This email is already being used" };
|
||||
|
@ -27,7 +27,7 @@ const ForgotPasswordPage: BlitzPage = () => {
|
||||
onSubmit={async (values) => {
|
||||
try {
|
||||
await forgotPasswordMutation(values);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
return {
|
||||
[FORM_ERROR]: "Sorry, we had an unexpected error. Please try again.",
|
||||
};
|
||||
|
@ -34,7 +34,7 @@ const ResetPasswordPage: BlitzPage = () => {
|
||||
onSubmit={async (values) => {
|
||||
try {
|
||||
await resetPasswordMutation(values);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
if (error.name === "ResetPasswordError") {
|
||||
return {
|
||||
[FORM_ERROR]: error.message,
|
||||
|
Reference in New Issue
Block a user