This commit is contained in:
Balakrishnan Balasubramanian 2018-12-19 02:37:43 -05:00
parent c32e22ac97
commit ba33ced6ab

View File

@ -69,7 +69,7 @@ def write(data):
def validate_password(password): def validate_password(password):
if not compare_digest(Session.password_hash, sha256(password).hexdigest()): if not compare_digest(Session.password_hash, sha256(password.encode()).hexdigest()):
raise AuthError("Invalid user pass") raise AuthError("Invalid user pass")
@ -269,4 +269,4 @@ async def a_main(*args, **kwargs):
if __name__ == "__main__": if __name__ == "__main__":
asyncio.run(a_main(Path("/tmp/mails"), 9995, password_hash=sha256("dummy").hexdigest())) asyncio.run(a_main(Path("/tmp/mails"), 9995, password_hash=sha256("dummy".encode()).hexdigest()))