From a84f3547fadde724bf8cd3162c6df2c55618ee01 Mon Sep 17 00:00:00 2001 From: Shayne Czyzewski <523636+shayneczyzewski@users.noreply.github.com> Date: Thu, 13 Oct 2022 18:04:45 +0200 Subject: [PATCH] Fixes login issue for uppercase usernames (#751) --- waspc/data/Generator/templates/server/src/routes/auth/login.js | 2 +- waspc/examples/todoApp/.gitignore | 2 ++ web/docs/language/features.md | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/waspc/data/Generator/templates/server/src/routes/auth/login.js b/waspc/data/Generator/templates/server/src/routes/auth/login.js index de2e97c57..7825caf03 100644 --- a/waspc/data/Generator/templates/server/src/routes/auth/login.js +++ b/waspc/data/Generator/templates/server/src/routes/auth/login.js @@ -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() } diff --git a/waspc/examples/todoApp/.gitignore b/waspc/examples/todoApp/.gitignore index 6b0390424..d319a97e8 100644 --- a/waspc/examples/todoApp/.gitignore +++ b/waspc/examples/todoApp/.gitignore @@ -1,2 +1,4 @@ /.wasp/ .env +.env.server +.env.client \ No newline at end of file diff --git a/web/docs/language/features.md b/web/docs/language/features.md index 0a07dfa21..66a228bb8 100644 --- a/web/docs/language/features.md +++ b/web/docs/language/features.md @@ -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