diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index 0a3385d..916a0fc 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -1,13 +1,14 @@ import { FC, ReactNode } from 'react'; import { Main } from '@/app/ui/Main'; -import { authConfig } from "@/app/lib/auth"; +import { authConfig, myAuth } from "@/app/lib/auth"; import { SignInButton } from '@/app/ui/SignInButton'; import Image from 'next/image'; -import { getTranslations } from "next-intl/server"; +import { getTranslations, getLocale } from "next-intl/server"; import isWebview from "is-ua-webview"; -import { headers } from 'next/headers' +import { headers } from 'next/headers'; import { ExclamationTriangleIcon } from "@heroicons/react/24/outline"; +import Link from 'next/link'; type Provider = { id: string; @@ -38,6 +39,8 @@ function getKeyValuesFromObject(obj: any, keys: (keyof T)[]): T { const Page:FC = async () => { + const session = await myAuth(); + const locale = await getLocale(); const providers = await getProviders(); const t = await getTranslations("login-page"); // get userAgent from NextJS @@ -76,11 +79,21 @@ const Page:FC = async () => { } { - Object.values(providers).map((provider) => ( -
- -
- )) + session ? ( + + logo + {t("main-card.go-to-app")} + + ) : ( + Object.values(providers).map((provider) => ( +
+ +
+ )) + ) }