UI - admin authentication and bootstrap update

This commit is contained in:
bunkerity
2021-07-09 14:17:50 +02:00
parent 6be082e0a9
commit 0d3f7d3925
9 changed files with 68 additions and 22 deletions

View File

@@ -3,14 +3,11 @@ import flask_login, bcrypt
class User(flask_login.UserMixin) :
def __init__(self, id, password) :
self.is_authenticated = True
self.is_active = True
self.is_anonymous = False
self.__id = id
self.__password = bcrypt.hashpw(password, bcrypt.gensalt())
self.__password = bcrypt.hashpw(password.encode("utf-8"), bcrypt.gensalt())
def get_id(self) :
return self.__id
def check_password(self, password) :
return bcrypt.checkpw(password, self.__password)
return bcrypt.checkpw(password.encode("utf-8"), self.__password)