Skip to content

Commit

Permalink
Fix case sensitivity issue when retrieving user by username
Browse files Browse the repository at this point in the history
The commit fixes a bug where the user object was not found due to case sensitivity in the username. Now, the username is converted to lowercase before querying the database.
  • Loading branch information
realashleybailey committed Oct 3, 2023
1 parent 601b2d2 commit 18f1cc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/api/routes/mfa_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def post(self):
return {"message": "No username found"}, 400

# Get the user from the database
user = Accounts.get_or_none(Accounts.username == username)
user = Accounts.get_or_none(Accounts.username == username.lower())

# Check if the user exists
if not user:
Expand Down

0 comments on commit 18f1cc4

Please sign in to comment.