fix: increase the length of the password to maximum possible under current structure

This commit is contained in:
Mangesh-Khairnar 2020-04-16 14:26:55 +05:30
parent aef809d67a
commit feba8878d9

View file

@ -131,9 +131,9 @@ def create_auth_table():
frappe.db.create_auth_table()
def encrypt(pwd):
if len(pwd) > 100:
# encrypting > 100 chars will lead to truncation
frappe.throw(_('Password cannot be more than 100 characters long'))
if len(pwd) > 127:
# encrypting > 127 chars will lead to truncation
frappe.throw(_('Password cannot be more than 127 characters long'))
cipher_suite = Fernet(encode(get_encryption_key()))
cipher_text = cstr(cipher_suite.encrypt(encode(pwd)))