Skip to content

Commit

Permalink
refactor: call extract_domain once
Browse files Browse the repository at this point in the history
  • Loading branch information
jawabuu authored and max-wittig committed Oct 15, 2024
1 parent 8fdfa74 commit 467070b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions oidc/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ def dispatch(self, request: HttpRequest, helper) -> Response: # type: ignore
return helper.error(ERR_INVALID_RESPONSE)

# support legacy style domains with pure domain regexp
user_domain = extract_domain(payload["email"])
if self.version is None:
domain = extract_domain(payload["email"])
domain = user_domain
else:
domain = payload.get("hd", extract_domain(payload["email"]))
domain = payload.get("hd", user_domain)

if domain is None:
return helper.error(ERR_INVALID_DOMAIN % (domain,))
Expand Down

0 comments on commit 467070b

Please sign in to comment.