UI - init work on admin account

This commit is contained in:
bunkerity
2021-07-09 12:18:42 +02:00
parent 4947796c99
commit 6be082e0a9
4 changed files with 61 additions and 1 deletions

16
ui/src/User.py Normal file
View File

@@ -0,0 +1,16 @@
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())
def get_id(self) :
return self.__id
def check_password(self, password) :
return bcrypt.checkpw(password, self.__password)