diff --git a/oidc/views.py b/oidc/views.py index 6d040c2..eb28673 100644 --- a/oidc/views.py +++ b/oidc/views.py @@ -43,10 +43,11 @@ def dispatch(self, request, helper): 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,))