-
I have these routes defined /login, /logout in my app. And login/logout seem to be working. However, I noticed that the functions I defined for /logout and /login routes are not reached. I tried to override the routes in the configuration using SECURITY_LOGOUT_URL and SECURITY_LOGIN_URL. First I used the routes as defined in the app, then I renamed the paths to /auth/login and /auth/logout and used those in the overrides. No dice. If I removed the override and kept the renamed routes, the renamed routes work. So it seems to me the URL override do not work at all. Any clues? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If I am understanding your question - I think you have things reversed! Flask-Security defines views such as login, logout, reset, change - and has flask map a URL to those views. So - if your application wants to reference FS's login view with the URL "/auth/userlogin" that's what the LOGIN_URL is for. IF you want your OWN login/logout views the only thing you can do is have Flask-Security not register its blueprint at all - and you defines all the endpoints. Setting 'register_blueprint=False" will stop FS from registering any endpoints. I would ask however - if you are replacing the endpoint/view - you are removing a lot of FS functionality - there are many ways to augment the login/logout process w/o replacing the entire view. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I was misunderstanding the URL overrides use. |
Beta Was this translation helpful? Give feedback.
If I am understanding your question - I think you have things reversed! Flask-Security defines views such as login, logout, reset, change - and has flask map a URL to those views. So - if your application wants to reference FS's login view with the URL "/auth/userlogin" that's what the LOGIN_URL is for. IF you want your OWN login/logout views the only thing you can do is have Flask-Security not register its blueprint at all - and you defines all the endpoints. Setting 'register_blueprint=False" will stop FS from registering any endpoints.
I would ask however - if you are replacing the endpoint/view - you are removing a lot of FS functionality - there are many ways to augment the login/log…