forked from github/server
Merge branch 'master' into develop
This commit is contained in:
commit
a4b4ba3859
|
@ -70,9 +70,9 @@ class EPasswd:
|
||||||
pw = self.get_passwd(id)
|
pw = self.get_passwd(id)
|
||||||
if pw[0:4]=='$2a$' or pw[0:4]=='$2y$':
|
if pw[0:4]=='$2a$' or pw[0:4]=='$2y$':
|
||||||
try:
|
try:
|
||||||
h1 = pw.encode('utf8')
|
uhash = pw.encode('utf8')
|
||||||
h2 = passwd.encode('utf8')
|
upass = passwd.encode('utf8')
|
||||||
return bcrypt.checkpw(h1, h2)
|
return bcrypt.checkpw(upass, uhash)
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
return pw == passwd
|
return pw == passwd
|
||||||
|
|
Loading…
Reference in New Issue