diff --git a/src/actions/auth-precheck.ts b/src/actions/auth-precheck.ts index b5eee29a35..3c35350309 100644 --- a/src/actions/auth-precheck.ts +++ b/src/actions/auth-precheck.ts @@ -27,7 +27,7 @@ export async function precheckLogin( const u = String(username ?? "") .normalize("NFC") .trim(); - const p = String(password ?? ""); + const p = String(password ?? "").normalize("NFC"); if (!u || !p) return "invalid"; const ip = await clientIp(); diff --git a/src/lib/auth.ts b/src/lib/auth.ts index 0521ea5d0d..594b06acae 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -149,8 +149,10 @@ export const { handlers, signOut, auth } = NextAuth({ code: { label: "2FA code", type: "text" }, }, authorize: async (credentials) => { - const username = String(credentials?.username ?? "").trim(); - const password = String(credentials?.password ?? ""); + const username = String(credentials?.username ?? "") + .normalize("NFC") + .trim(); + const password = String(credentials?.password ?? "").normalize("NFC"); if (!username || !password) return null; const ip = await clientIp();