Commit 354f5df2 authored by Administrator's avatar Administrator

Fix login after session format change

parent 373e6a23
......@@ -161,7 +161,10 @@ class SecurityManager:
summary, hash = map(lambda s: s.encode("utf-8"), parts)
maccer = self.maccer.copy()
session_duration = - User.from_hashstring(string).timestamp
user = User.from_hashstring(string)
if user is None:
return False
session_duration = - user.timestamp
macs_equal = hmac.compare_digest(maccer.hexdigest().encode("utf-8"), hash)
time_short = int(session_duration.total_seconds()) < self.max_duration
return macs_equal and time_short
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment