Refactor sign in error handling

This commit is contained in:
Sam Becker 2024-01-06 14:27:28 -06:00
parent 3e45616870
commit 5791a73e7b

View File

@ -9,7 +9,7 @@ export const signInAction = async (
try {
await signIn('credentials', Object.fromEntries(formData));
} catch (error) {
if ((error as Error).message.includes(CREDENTIALS_SIGN_IN_ERROR)) {
if ((`${error}`).includes(CREDENTIALS_SIGN_IN_ERROR)) {
return CREDENTIALS_SIGN_IN_ERROR;
}
throw error;