diff --git a/oidc/views.py b/oidc/views.py index 68491c5..6d040c2 100644 --- a/oidc/views.py +++ b/oidc/views.py @@ -46,7 +46,7 @@ def dispatch(self, request, helper): if self.version is None: domain = extract_domain(payload["email"]) else: - domain = payload.get("hd") + domain = payload.get("hd", extract_domain(payload["email"])) if domain is None: return helper.error(ERR_INVALID_DOMAIN % (domain,))