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

Login button should redirect to last page #161

Open
AetherUnbound opened this issue Jul 23, 2022 · 2 comments
Open

Login button should redirect to last page #161

AetherUnbound opened this issue Jul 23, 2022 · 2 comments
Labels
frontend Related to the frontend/client-side good first issue Good for newcomers hacktoberfest Good hacktoberfest issues help wanted Extra attention is needed

Comments

@AetherUnbound
Copy link
Collaborator

I frequently run into a scenario where I'm on a page and want to log in. I click the login link, log in, and then get redirected back to the home page. It would be nice if I could go from page -> login -> back to page. This would probably require storing the previous page in the URL parameters of the login page.

@AetherUnbound AetherUnbound added frontend Related to the frontend/client-side good first issue Good for newcomers help wanted Extra attention is needed labels Jul 23, 2022
@sea-kelp
Copy link
Collaborator

(Adding this here for reference: https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html)

@AetherUnbound AetherUnbound added the hacktoberfest Good hacktoberfest issues label Oct 2, 2022
@sea-kelp
Copy link
Collaborator

sea-kelp commented Oct 16, 2022

Capturing some discussions about how to re-implement this safely:

  • Require the next parameter to be POST-ed instead of passing it as a query variable
  • Either keep a whitelist of permitted redirect urls or use urllib.parse to ensure the redirect url doesn't contain a scheme or hostname

Alternatively, if USE_SESSION_FOR_NEXT is True, the page is stored in the session under the key next.
https://flask-login.readthedocs.io/en/latest/#customizing-the-login-process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Related to the frontend/client-side good first issue Good for newcomers hacktoberfest Good hacktoberfest issues help wanted Extra attention is needed
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants