feat(auth): modify signIn logic to prevent redirect after credentials sign-in

This commit is contained in:
cfngc4594 2025-03-22 13:18:06 +08:00
parent 107f5d6670
commit 985da4f804

View File

@ -33,7 +33,7 @@ export async function signInWithCredentials(formData: CredentialsSignInFormValue
throw new Error("Incorrect password.");
}
await signIn("credentials", formData);
await signIn("credentials", { ...formData, redirect: false });
return { success: true };
} catch (error) {
return { error: error instanceof Error ? error.message : "Failed to sign in. Please try again." };