diff --git a/apps/web/pages/auth/sso/[provider].tsx b/apps/web/pages/auth/sso/[provider].tsx index 8aa522667f9c8d..5ea01f8dc9b46f 100644 --- a/apps/web/pages/auth/sso/[provider].tsx +++ b/apps/web/pages/auth/sso/[provider].tsx @@ -19,9 +19,8 @@ export default function Provider(props: SSOProviderPageProps) { const router = useRouter(); useEffect(() => { + const email = searchParams?.get("email"); if (props.provider === "saml") { - const email = searchParams?.get("email"); - if (!email) { router.push(`/auth/error?error=Email not provided`); return; @@ -33,6 +32,8 @@ export default function Provider(props: SSOProviderPageProps) { } signIn("saml", {}, { tenant: props.tenant, product: props.product }); + } else if (props.provider === "google" && email) { + signIn("google", {}, { login_hint: email }); } else { signIn(props.provider); } diff --git a/apps/web/pages/signup.tsx b/apps/web/pages/signup.tsx index 49015ba22afc8f..2620efd1757c0e 100644 --- a/apps/web/pages/signup.tsx +++ b/apps/web/pages/signup.tsx @@ -428,8 +428,7 @@ export default function Signup({ : t("create_account")} - {/* Continue with Social Logins - Only for non-invite links */} - {token || (!isGoogleLoginEnabled && !isSAMLLoginEnabled) ? null : ( + {!isGoogleLoginEnabled && !isSAMLLoginEnabled ? null : (
@@ -440,91 +439,93 @@ export default function Signup({
)} - {/* Social Logins - Only for non-invite links*/} - {!token && ( -
- {isGoogleLoginEnabled ? ( - - ) : null} - {isSAMLLoginEnabled ? ( - - ) : null} -
- )} + const url = searchQueryParams.toString() + ? `${GOOGLE_AUTH_URL}?${searchQueryParams.toString()}` + : GOOGLE_AUTH_URL; + + router.push(url); + }}> + Google + + ) : null} + {isSAMLLoginEnabled ? ( + + ) : null} +
{/* Already have an account & T&C */}