forked from github/server
fix bcrypt use
This commit is contained in:
parent
d5c1cb6762
commit
0beec878c6
1 changed files with 3 additions and 3 deletions
|
@ -70,9 +70,9 @@ class EPasswd:
|
|||
pw = self.get_passwd(id)
|
||||
if pw[0:4]=='$2a$' or pw[0:4]=='$2y$':
|
||||
try:
|
||||
h1 = pw.encode('utf8')
|
||||
h2 = passwd.encode('utf8')
|
||||
return bcrypt.checkpw(h1, h2)
|
||||
uhash = pw.encode('utf8')
|
||||
upass = passwd.encode('utf8')
|
||||
return bcrypt.checkpw(upass, uhash)
|
||||
except:
|
||||
return False
|
||||
return pw == passwd
|
||||
|
|
Loading…
Reference in a new issue