jasminefiner
9/26/2018 - 10:14 AM

09

UMS Email Password Reset 9

# app/models.py
# ...
class User(UserMixin, db.Model):
    # ...
    def generate_password_reset_token(self, expiration=3600):
        s = JSONWebSignatureSerializer(current_app.config['SECRET_KEY'])
        return s.dumps({'reset_password': self.id}).decode('utf-8')