Skip to content

Commit

Permalink
fix: lowercase the user_id (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 authored Feb 21, 2024
1 parent 499786d commit 21444ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ def authentication(
if r.status_code == 200:
# form_data.username can be the user_id or the email, so we need to
# fetch the user_id from the response
user_id = r.json()["user_id"]
# We also need to lowercase the user_id as it's case-insensitive
user_id = r.json()["user_id"].lower()
token = create_token(user_id)
session, *_ = crud.create_session(db, user_id=user_id, token=token)
session = crud.update_session_last_used_field(db, session=session)
Expand Down

0 comments on commit 21444ff

Please sign in to comment.