.
This commit is contained in:
10
app/models.py
Normal file
10
app/models.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from werkzeug.security import generate_password_hash, check_password_hash
|
||||
from flask_login import UserMixin
|
||||
|
||||
|
||||
class User(UserMixin):
|
||||
def set_password(self, password):
|
||||
self.password_hash = generate_password_hash(password)
|
||||
|
||||
def check_password(self, password):
|
||||
return check_password_hash(self.password_hash, password)
|
||||
Reference in New Issue
Block a user