-
-
Notifications
You must be signed in to change notification settings - Fork 512
SECURITY_POST_LOGIN_VIEW conflict with 'next' #850
Comments
I have cloned this issue to my 'fork'. This behavior goes way back - basically - when redirecting (post login, post register, post logout) it will look first at request.args.next, then request.form.next and THEN the config view. To do what you want is actually pretty easy: security.login_manager.unauthorized_handler(unauth) see if that works for you. |
Hey @jwag956, thanks for the input! I did try using the For my use case I only want calls to the root endpoint (eg In theory I should be able to conditionally redirect in the Is there a way I could get access to the original request object for conditional rerouting? |
Not quite sure your setup. But if you decorate your method with @login_required, and you aren't authenticated, 'unauth' will be called prior to anything in FS being called (assuming you are using session cookies and not auth tokens. |
I'm having an issue with SECURITY_POST_LOGIN_VIEW that appears identical to #263 and is probably related to #261 except that I'm running Flask-Security version
3.0.0
.I'm setting my config var as
SECURITY_POST_LOGIN_VIEW = '/logged_in'
If I originate from
/login
exactly, the SECURITY_POST_LOGIN_VIEW works as anticipated. However users visiting/
get redirected to/login?next=%2F
and SECURITY_POST_LOGIN_VIEW does not work when they login.It seems like this is an issue that has already been encountered and I'm not properly addressing something? Any thoughts?
The text was updated successfully, but these errors were encountered: