Skip to content

Commit 1e6b27a

Browse files
authored
fix: ensure correct status code for unverified email in sign-in (#1262)
1 parent 9719fee commit 1e6b27a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/better-auth/src/api/routes/sign-in.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ export const signInEmail = createAuthEndpoint(
385385
!user.user.emailVerified
386386
) {
387387
if (!ctx.context.options?.emailVerification?.sendVerificationEmail) {
388-
throw new APIError("UNAUTHORIZED", {
388+
throw new APIError("FORBIDDEN", {
389389
message: BASE_ERROR_CODES.EMAIL_NOT_VERIFIED,
390390
});
391391
}

0 commit comments

Comments
 (0)