diff --git a/app/login/utils.ts b/app/login/utils.ts index 667621a04..83b38ae4e 100644 --- a/app/login/utils.ts +++ b/app/login/utils.ts @@ -1,7 +1,6 @@ import { Theme } from "@mui/material"; import { makeStyles } from "@mui/styles"; -import { getProviders, useSession } from "next-auth/react"; -import React from "react"; +import { useSession } from "next-auth/react"; import { HEADER_HEIGHT } from "@/components/header"; @@ -24,39 +23,10 @@ export const useRootStyles = makeStyles((theme) => ({ export const useUser = () => { const { data: session, status: sessionStatus } = useSession(); - const { data: providers, status: providersStatus } = useProviders(); - if (sessionStatus === "loading" || providersStatus === "loading") { - return null; - } - - if (!providers || !Object.keys(providers).length) { - return null; - } - - if (!session) { + if (sessionStatus === "loading" || !session) { return null; } return session.user; }; - -type Providers = Awaited>; - -const useProviders = () => { - const [state, setState] = React.useState({ - status: "loading", - data: undefined as Providers | undefined, - }); - - React.useEffect(() => { - const run = async () => { - const providers = await getProviders(); - setState({ status: "loaded", data: providers }); - }; - - run(); - }, []); - - return state; -};