def generate_reset_token(self, expiration=3600):
"""Generate token for password reset only with email address.
"""
s = Serializer(current_app.config['SECRET_KEY'], expiration)
return s.dumps({'reset': self.id})
文章目录