From 06ba45bbeb66bb7c742e9c42f65c3cc1c457a33d Mon Sep 17 00:00:00 2001 From: Knee Cola Date: Sat, 29 Nov 2025 13:13:15 +0100 Subject: [PATCH 1/2] Show 'Go to App' button for authenticated users on landing page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of displaying sign-in buttons to already authenticated users, the homepage now detects authentication status and shows a 'Go to App' button that redirects to the home page. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/[locale]/page.tsx | 29 +++++++++++++++++++++-------- messages/en.json | 1 + messages/hr.json | 1 + 3 files changed, 23 insertions(+), 8 deletions(-) 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) => ( +
+ +
+ )) + ) }