Skip to content

Commit

Permalink
Missing a proper return if REDIRECT_ALLOW_SUBDOMAINS was False.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Hardison committed May 30, 2024
1 parent 7c6855f commit f8f2aa6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions flask_security/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,10 +657,12 @@ def validate_redirect_url(url: str) -> bool:

return False

# Fall through to the original check if we don't have a list of allowed subdomains.
# Fall through to the original check if we don't have a
# list of allowed subdomains.

if (
base_domain
config_value("REDIRECT_ALLOW_SUBDOMAINS")
and base_domain
and (
url_next.netloc == base_domain
or url_next.netloc.endswith(f".{base_domain}")
Expand All @@ -669,6 +671,9 @@ def validate_redirect_url(url: str) -> bool:
return True
else:
return False
else:
return False

return True


Expand Down

0 comments on commit f8f2aa6

Please sign in to comment.