diff --git a/src/pages/auth/login/index.tsx b/src/pages/auth/login/index.tsx index 82157b4b..bdd32f25 100644 --- a/src/pages/auth/login/index.tsx +++ b/src/pages/auth/login/index.tsx @@ -9,7 +9,7 @@ import CredentialsForm from "~/components/auth/credentialsForm"; import Link from "next/link"; import { api } from "~/utils/api"; -const Login = ({ title, oauthExlusiveLogin }) => { +const Login = ({ title, oauthExclusiveLogin, oauthEnabled }) => { const currentYear = new Date().getFullYear(); const { data: options, isLoading: loadingRegistration } = api.public.registrationAllowed.useQuery(); @@ -27,12 +27,15 @@ const Login = ({ title, oauthExlusiveLogin }) => {

Sign in to your account

- {!oauthExlusiveLogin && } + {!oauthExclusiveLogin && } + + {oauthEnabled && ( +
+ {!oauthExclusiveLogin &&
OR
} + +
+ )} -
- {!oauthExlusiveLogin &&
OR
} - -
{options?.enableRegistration && !loadingRegistration ? (

Don't have an account?

@@ -58,11 +61,12 @@ interface Props { export const getServerSideProps: GetServerSideProps = async ( context: GetServerSidePropsContext, ) => { - const oauthExlusiveLogin = process.env.OAUTH_EXCLUSIVE_LOGIN === "true"; + const oauthExclusiveLogin = process.env.OAUTH_EXCLUSIVE_LOGIN === "true"; + const oauthEnabled = !!process.env.OAUTH_ID && !!process.env.OAUTH_SECRET; const session = await getSession(context); if (!session || !session.user) { - return { props: { oauthExlusiveLogin } }; + return { props: { oauthExclusiveLogin, oauthEnabled } }; } if (session.user) {