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: fix redirect traversal bugs #29

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Conversation

robvdl
Copy link
Member

@robvdl robvdl commented Mar 11, 2024

Two issues this fixes:

  1. When using Traversal (which hasn't been committed yet), request.matched_route will be None which crashes if you access request.matched_route.name

  2. It needed to look at the request method (being POST or GET), otherwise it always ended up redirecting to request.route_path("home").

This part should never have run if the request method was POST:

>>> return_url = request.route_path("home")

Closes #28

Two issues this fixes:

1. When using Traversal (which hasn't been committed yet), request.matched_route will be None which crashes if you access request.matched_route.name

2. It needed to look at the request method (being POST or GET), otherwise it always ended up redirecting to request.route_path("home").

This part should never have run if the request method was POST:

    >>> return_url = request.route_path("home")

Closes #28
@robvdl robvdl merged commit a998da3 into master Mar 11, 2024
1 check passed
@robvdl robvdl deleted the login-redirect-traversal-fix branch March 11, 2024 01:48
@robvdl
Copy link
Member Author

robvdl commented Mar 11, 2024

It probably wouldn't hurt writing additional testcases for this later.

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

Successfully merging this pull request may close these issues.

bug: when using traversal the login screen will get None for request.matched_route and crash
1 participant