I want to create a page to edit some user data, including the password. How can I change the password in my own view with Flask-Security?
Asked
Active
Viewed 3,700 times
1 Answers
7
Use hash_password
to hash the password with Flask-Security.
from flask_security.utils import hash_password
user.password = hash_password('Stack Overflow')
Unless you have a good reason not to, you should use the built-in change password view and form. Flask-Security offers the ability to customize both. Leaving the change password form in its own page is a common pattern.

davidism
- 121,510
- 29
- 395
- 339