Fixes login issue for uppercase usernames (#751)

This commit is contained in:
Shayne Czyzewski 2022-10-13 18:04:45 +02:00 committed by GitHub
parent 6d0affac49
commit a84f3547fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -12,7 +12,7 @@ export default handleRejection(async (req, res) => {
const context = {}
// Try to fetch user with the given username.
const user = await prisma.{= userEntityLower =}.findUnique({ where: { username: args.username.toLowerCase() } })
const user = await prisma.{= userEntityLower =}.findUnique({ where: { username: args.username } })
if (!user) {
return res.status(401).send()
}

View File

@ -1,2 +1,4 @@
/.wasp/
.env
.env.server
.env.client

View File

@ -827,7 +827,7 @@ Default value is "/".
### Username and Password
`usernameAndPassword` authentication method makes it possible to signup/login into the app by using a username and password.
This method requires that `userEntity` specified in `auth` contains `username: string` and `password: string` fields.
This method requires that `userEntity` specified in `auth` contains `username: string` and `password: string` fields. `username`s are stored in a case-sensitive manner.
We provide basic validations out of the box, which you can customize as shown below. Default validations are:
- `username`: non-empty