Code refactoring and bug fixes

This commit is contained in:
Khanh Ngo
2020-06-19 08:47:51 +07:00
parent 5eb2edee2c
commit a3fd856dd8
14 changed files with 152 additions and 166 deletions

View File

@ -91,9 +91,9 @@ class ApiKey(db.Model):
current_app.config.get('SALT').encode('utf-8'))
def check_password(self, hashed_password):
# Check hased password. Using bcrypt,
# Check hashed password. Using bcrypt,
# the salt is saved into the hash itself
if (self.plain_text_password):
if self.plain_text_password:
return bcrypt.checkpw(self.plain_text_password.encode('utf-8'),
hashed_password.encode('utf-8'))
return False