fix: case-insensitive email matching in auth and password reset
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m10s
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m10s
Email lookups used findUnique (case-sensitive on PostgreSQL) but user input was lowercased, causing login failures for users with mixed-case emails stored in the DB (e.g. Laurent_Faure@dietsmann.com). Also normalized 7 affected emails to lowercase on the production DB. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1595,9 +1595,9 @@ export const userRouter = router({
|
||||
.mutation(async ({ ctx, input }) => {
|
||||
const email = input.email.toLowerCase().trim()
|
||||
|
||||
// Find user by email
|
||||
const user = await ctx.prisma.user.findUnique({
|
||||
where: { email },
|
||||
// Find user by email (case-insensitive — DB may store mixed-case emails)
|
||||
const user = await ctx.prisma.user.findFirst({
|
||||
where: { email: { equals: email, mode: 'insensitive' } },
|
||||
select: { id: true, email: true, name: true, status: true },
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user