mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Typo
This commit is contained in:
parent
7482f052f6
commit
d7a33e5a14
1 changed files with 2 additions and 2 deletions
|
@ -150,7 +150,7 @@ class BaseAuthenticator(object):
|
||||||
|
|
||||||
# We store a hash of the session_id and the session_token (the token is assumed to be secret)
|
# We store a hash of the session_id and the session_token (the token is assumed to be secret)
|
||||||
to_hash = "{id}:{token}".format(id=session_id, token=session_token)
|
to_hash = "{id}:{token}".format(id=session_id, token=session_token)
|
||||||
hash_ = hashlib.sha256sum(to_hash).hexdigest()
|
hash_ = hashlib.sha256(to_hash).hexdigest()
|
||||||
with self._open_sessionfile(session_id, 'w') as f:
|
with self._open_sessionfile(session_id, 'w') as f:
|
||||||
f.write(hash_)
|
f.write(hash_)
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ class BaseAuthenticator(object):
|
||||||
raise MoulinetteError('unable_retrieve_session', exception=e)
|
raise MoulinetteError('unable_retrieve_session', exception=e)
|
||||||
else:
|
else:
|
||||||
to_hash = "{id}:{token}".format(id=session_id, token=session_token)
|
to_hash = "{id}:{token}".format(id=session_id, token=session_token)
|
||||||
hash_ = hashlib.sha256sum(to_hash).hexdigest()
|
hash_ = hashlib.sha256(to_hash).hexdigest()
|
||||||
|
|
||||||
if hash_ != stored_hash:
|
if hash_ != stored_hash:
|
||||||
raise MoulinetteError('invalid_token')
|
raise MoulinetteError('invalid_token')
|
||||||
|
|
Loading…
Add table
Reference in a new issue