Fix: if the login attempt failed, return None
This commit is contained in:
parent
7c5cbd4291
commit
eb7f85d966
1 changed files with 1 additions and 2 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue