lingthio / Flask-User

Customizable User Authorization & User Management: Register, Confirm, Login, Change username/password, Forgot password and more.
http://flask-user.readthedocs.io/
MIT License
1.06k stars 294 forks source link

How to include verify_password in blueprint routes? #320

Closed stardeltapower closed 4 years ago

stardeltapower commented 4 years ago

Hi,

I've been using flask_user for a while now, mainly for the role:required view decorator, but all of a sudden need to start using other functionality from the package.

I'm trying to understand how I can add a verify_password on a single route within a blueprint. I can see that I need to use the verify_password function, but how do I call it within my routes file?

Using the below doesn't work. I'm sure I'm missing something. from flask_user import verify_password

stardeltapower commented 4 years ago

Solved it myself...

from flask import current_app
user_manager = current_app.user_manager
user_manager.verify_password()