add salt
This commit is contained in:
parent
ba33ced6ab
commit
54ab1c7f98
@ -69,7 +69,9 @@ def write(data):
|
|||||||
|
|
||||||
|
|
||||||
def validate_password(password):
|
def validate_password(password):
|
||||||
if not compare_digest(Session.password_hash, sha256(password.encode()).hexdigest()):
|
salt = "balki is awesome+"
|
||||||
|
salted = f"{salt}{password}"
|
||||||
|
if not compare_digest(Session.password_hash, sha256(salted.encode()).hexdigest()):
|
||||||
raise AuthError("Invalid user pass")
|
raise AuthError("Invalid user pass")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user