diff --git a/oidc/views.py b/oidc/views.py index 38fa391..ce9e641 100644 --- a/oidc/views.py +++ b/oidc/views.py @@ -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,))