UI - admin authentication and bootstrap update
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user