Skip to content

Commit

Permalink
Merge pull request #43 from djpugh/fix/is-valid-redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
djpugh authored Dec 18, 2020
2 parents 10d7b0e + cdd12ab commit 3358cd7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/fastapi_aad_auth/_base/validators/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def set_post_auth_redirect(self, request, redirect='/'):

def is_valid_redirect(self, redirect):
"""Check if the redirect is not to endpoints that we don't want to redirect to."""
if redirect is None:
return False
return not any(map(partial(fnmatch.fnmatch, redirect), self._ignore_redirect_routes))

@staticmethod
Expand Down

0 comments on commit 3358cd7

Please sign in to comment.