feat: dont disable oidc when DISABLE_REGISTRATION is on
This commit is contained in:
parent
68c8be4988
commit
19bf0802ba
|
|
@ -5,6 +5,7 @@ import { Metadata } from 'next';
|
|||
import { isGeneralServerSide } from '@gitroom/helpers/utils/is.general.server.side';
|
||||
import Link from 'next/link';
|
||||
import { getT } from '@gitroom/react/translation/get.translation.service.backend';
|
||||
import { LoginWithOidc } from '@gitroom/frontend/components/auth/login.with.oidc';
|
||||
export const metadata: Metadata = {
|
||||
title: `${isGeneralServerSide() ? 'Postiz' : 'Gitroom'} Register`,
|
||||
description: '',
|
||||
|
|
@ -18,13 +19,16 @@ export default async function Auth() {
|
|||
).register;
|
||||
if (!canRegister) {
|
||||
return (
|
||||
<div className="text-center">
|
||||
{t('registration_is_disabled', 'Registration is disabled')}
|
||||
<br />
|
||||
<Link className="underline hover:font-bold" href="/auth/login">
|
||||
{t('login_instead', 'Login instead')}
|
||||
</Link>
|
||||
</div>
|
||||
<>
|
||||
<LoginWithOidc />
|
||||
<div className="text-center">
|
||||
{t('registration_is_disabled', 'Registration is disabled')}
|
||||
<br />
|
||||
<Link className="underline hover:font-bold" href="/auth/login">
|
||||
{t('login_instead', 'Login instead')}
|
||||
</Link>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
'use client';
|
||||
|
||||
import { OauthProvider } from '@gitroom/frontend/components/auth/providers/oauth.provider';
|
||||
import interClass from '@gitroom/react/helpers/inter.font';
|
||||
import { useT } from '@gitroom/react/translation/get.transation.service.client';
|
||||
import { useVariables } from '@gitroom/react/helpers/variable.context';
|
||||
|
||||
export const LoginWithOidc = () => {
|
||||
const { isGeneral, genericOauth } = useVariables();
|
||||
const t = useT();
|
||||
|
||||
if (!(isGeneral && genericOauth)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<h1 className="text-center text-3xl font-bold text-start mb-4 cursor-pointer">
|
||||
{t('sign_up', 'Sign Up')}
|
||||
</h1>
|
||||
</div>
|
||||
<OauthProvider />
|
||||
<div className="h-[20px] mb-[24px] mt-[24px] relative">
|
||||
<div className="absolute w-full h-[1px] bg-fifth top-[50%] -translate-y-[50%]" />
|
||||
<div
|
||||
className={`absolute z-[1] ${interClass} justify-center items-center w-full start-0 top-0 flex`}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
'use client';
|
||||
|
||||
import { useCallback } from 'react';
|
||||
import Image from 'next/image';
|
||||
import { useFetch } from '@gitroom/helpers/utils/custom.fetch';
|
||||
|
|
|
|||
Loading…
Reference in New Issue