force lower case login name

This commit is contained in:
tuxcoder 2024-02-18 20:17:08 +01:00
parent bdefee9d58
commit de6ed03ad8

View file

@ -134,7 +134,7 @@ async def login() -> ResponseReturnValue:
return redirect(resp.redirect_to)
form = LoginForm()
if form.validate_on_submit():
user = User.query.filter_by(username=form.data['name']).first() # type: Optional[User]
user = User.query.filter_by(username=form.data['name'].lower()).first() # type: Optional[User]
if user:
session['username'] = str(user.username)
else: