From a1a6dc9d6e345ff102d69164d4bf2d7020db0ea4 Mon Sep 17 00:00:00 2001 From: SeDemal Date: Mon, 2 Dec 2024 20:44:49 +0100 Subject: [PATCH] fix: Allow username to be capitalized on basic credentials login (#1585) --- .../providers/credentials/authorization/basic-authorization.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/auth/providers/credentials/authorization/basic-authorization.ts b/packages/auth/providers/credentials/authorization/basic-authorization.ts index a4debe69c..6357df7c6 100644 --- a/packages/auth/providers/credentials/authorization/basic-authorization.ts +++ b/packages/auth/providers/credentials/authorization/basic-authorization.ts @@ -11,7 +11,7 @@ export const authorizeWithBasicCredentialsAsync = async ( credentials: z.infer, ) => { const user = await db.query.users.findFirst({ - where: and(eq(users.name, credentials.name), eq(users.provider, "credentials")), + where: and(eq(users.name, credentials.name.toLowerCase()), eq(users.provider, "credentials")), }); if (!user?.password) {