Open mzrzvi opened 6 years ago
https://github.com/r-chowdhury/Flask-Course/blob/f637af46ba00c02e252f3dbcc26d0410af014f01/models/user.py#L14
from flask_security.utils import hash_password, verify_password ... class UserModel(db.Model): ... def __init__(self, username, password): self.username = username self.password = hash_password(password) def authenticate(self, password): return verify_password(password, self.password)
https://pythonhosted.org/Flask-Security/api.html?highlight=hash_password#flask_security.utils.hash_password
For other reference: https://pythonhosted.org/Flask-Security/api.html?highlight=hash_password
https://github.com/r-chowdhury/Flask-Course/blob/f637af46ba00c02e252f3dbcc26d0410af014f01/models/user.py#L14