From 39897564ff2c7d3c4a93c3e615636c44a5d78a58 Mon Sep 17 00:00:00 2001 From: Ryan Duffy Date: Wed, 13 Mar 2024 10:53:24 -0700 Subject: [PATCH] Revert "Add switch accounts interstitial to login flow (#10431)" This reverts commit 3c810694499d4c9b8ea890d07e3e1c726318168a. --- src/ui/components/shared/Login/Login.tsx | 44 +----------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/src/ui/components/shared/Login/Login.tsx b/src/ui/components/shared/Login/Login.tsx index 1381ff5f098..f1751485b44 100644 --- a/src/ui/components/shared/Login/Login.tsx +++ b/src/ui/components/shared/Login/Login.tsx @@ -1,7 +1,6 @@ import { gql } from "@apollo/client"; import { ExclamationIcon } from "@heroicons/react/outline"; import Link from "next/link"; -import { useRouter } from "next/router"; import { ReactNode, useEffect, useState } from "react"; import { Button } from "replay-next/components/Button"; @@ -9,13 +8,11 @@ import { query } from "shared/graphql/apolloClient"; import { GetConnection, GetConnectionVariables } from "shared/graphql/generated/GetConnection"; import { getReadOnlyParamsFromURL } from "shared/utils/environment"; import { isMacOS } from "shared/utils/os"; -import { UserInfo, useGetUserInfo } from "ui/hooks/users"; import { getAuthClientId, getAuthHost } from "ui/utils/auth"; import { requestBrowserLogin, setUserInBrowserPrefs } from "ui/utils/browser"; import { isTeamMemberInvite } from "ui/utils/onboarding"; import { sendTelemetryEvent } from "ui/utils/telemetry"; import useAuth0 from "ui/utils/useAuth0"; -import useToken from "ui/utils/useToken"; import { OnboardingContentWrapper, OnboardingModalContainer } from "../Onboarding"; @@ -129,35 +126,6 @@ function LoginMessaging() { ); } -function SwitchAccountMessage({ - user, - onSwitch, - onCancel, -}: { - user: UserInfo; - onCancel: () => void; - onSwitch: () => void; -}) { - return ( -
-

- You are already logged in as {user.email}. -

- - -
- ); -} - function SocialLogin({ onShowSSOLogin, onLogin, @@ -274,12 +242,8 @@ export default function Login({ challenge?: string; state?: string; }) { - const router = useRouter(); const { loginWithRedirect, error } = useAuth0(); const [sso, setSSO] = useState(false); - const [continueToLogin, setContinueToLogin] = useState(false); - const token = useToken(); - const user = useGetUserInfo(); const url = new URL(returnToPath, window.location.origin); if (url.pathname === "/login" || (url.pathname === "/" && url.searchParams.has("state"))) { @@ -309,13 +273,7 @@ export default function Login({ return ( - {token.token && user.email && !continueToLogin ? ( - setContinueToLogin(true)} - onCancel={() => router.push("/")} - /> - ) : global.__IS_RECORD_REPLAY_RUNTIME__ && isOSX ? ( + {global.__IS_RECORD_REPLAY_RUNTIME__ && isOSX ? ( ) : sso ? (