how to override login of flask-security?

Viewed 3797

I want to do some customization when a user login. The problem is that the project is using flask-security which is implicitly handles user login. I want to check some records of users in the database when users login.

how can i override "login" function in flask-security?

I saw similar post, tried but not working. Plus, it is not exactly what I want to do. I maybe need to stop the default behavior in case of some users.

So, anyone having this kind of issue? how can I do it?

Thanks!

2 Answers

after registering the flask security extension, you can create an endpoint with the exact same name/route and it should override the one registered by Flask-security.

If you are using blueprints, make sure you register your blueprint before registering Flask-security.

Related