Fix: if the login attempt failed, return None

This commit is contained in:
Reid 'arrdem' McKenzie 2023-06-22 15:01:21 -06:00
parent 7c5cbd4291
commit eb7f85d966

View file

@ -173,8 +173,7 @@ class Db(Queries):
digest.update(password.encode("utf-8")) digest.update(password.encode("utf-8"))
res = super().try_login(username=username, hash=digest.hexdigest()) res = super().try_login(username=username, hash=digest.hexdigest())
if not res: if not res:
res = self.fetch_user_status(sid=res.status_id) return None
raise LoginError(res.name)
return self.create_key(uid=res.id, name="web session", ttl=ttl) return self.create_key(uid=res.id, name="web session", ttl=ttl)