Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

405 error when logging in from non /login page #25

Open
tmthyjames opened this issue Jan 13, 2018 · 1 comment
Open

405 error when logging in from non /login page #25

tmthyjames opened this issue Jan 13, 2018 · 1 comment

Comments

@tmthyjames
Copy link
Owner

No description provided.

@sparklespdx
Copy link
Contributor

sparklespdx commented Apr 14, 2018

#30 is one way to fix this up. Our issue is that the 401 error handler is rendering the login page template for endpoints that aren't equipped to handle the LoginForm post. I'm handling this by actually redirecting to the login page instead, with the referring URL passed through the login page with the ?next URL parameter, and validating that parameter to make sure we only redirect to ourselves and not anywhere bad.

The end result is that you end up at whatever page you started out on before the redirect chain.

Patterned after this implemetation from Flask-Login: https://flask-login.readthedocs.io/en/latest/#login-example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants