fix: E-Mail wird als bytes statt str angezeigt (b'...' in der Navbar)
_row_to_user() dekodierte bislang nur hashed_password von bytes zu str, obwohl psycopg dieselbe Eigenart (TEXT-Spalte kommt teils als bytes zurück) auch bei email zeigt. Sichtbar z.B. im Header als b'name@domain.tld' statt name@domain.tld. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
dd12dd7b74
commit
af6e93067f
2
auth.py
2
auth.py
@ -44,6 +44,8 @@ def _row_to_user(row) -> User:
|
||||
# psycopg liefert TEXT-Spalten hier teils als bytes zurück, nicht als str.
|
||||
if isinstance(hashed_password, bytes):
|
||||
hashed_password = hashed_password.decode("utf-8")
|
||||
if isinstance(email, bytes):
|
||||
email = email.decode("utf-8")
|
||||
|
||||
return User(
|
||||
id=user_id,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user