From 6a147aa25392407b5b85ea4bec22b98423ef2f83 Mon Sep 17 00:00:00 2001 From: feco Date: Mon, 23 Nov 2026 10:13:20 +0000 Subject: [PATCH] Home page: logged-in users stay on it The home page no longer sends logged-in users to their chart: they see it with the app's header, the buttons lead to their chart, and the login hints and "without login" texts are left out. The login (and setting a password) now lands on /keplet by default, which still goes on to the profile when there is no chart yet. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL --- services/frontend/src/app/Landing.tsx | 50 ++++++++++--------- services/frontend/src/app/belepes/page.tsx | 3 +- .../src/app/jelszo/SetPasswordForm.tsx | 2 +- services/frontend/src/app/page.tsx | 6 +-- 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/services/frontend/src/app/Landing.tsx b/services/frontend/src/app/Landing.tsx index 26a6bbe..cd4d663 100644 --- a/services/frontend/src/app/Landing.tsx +++ b/services/frontend/src/app/Landing.tsx @@ -40,16 +40,18 @@ const CHAPTERS = ["Személyiség", "Érzelmek", "Gondolkodás", "Szerelem", "Hiv const SYNASTRY_TOPICS = ["Vonzás", "Kommunikáció", "Érzelmi kötődés", "Súrlódások", "Hosszú táv"]; /** The home page for visitors: what the site does, shown on the example chart. */ -export function Landing({ inviteOnly }: { inviteOnly: boolean }) { +/** `loggedIn`: the layout shows the app's header, and the buttons lead to the user's chart instead of the login. */ +export function Landing({ inviteOnly, loggedIn = false }: { inviteOnly: boolean; loggedIn?: boolean }) { const chart = example.chart as unknown as ChartResult; const analysis = example.analysis as AnalysisContent; const sections = ["emotions", "love"].map((k) => analysis.sections?.[k]).filter((s) => s !== undefined); const lead = (analysis.summary ?? "").split(/(?<=\.)\s/)[0]; - const signIn = inviteOnly ? "Belépés meghívóval" : "Elkészítem a képletem"; + const signIn = loggedIn ? "A képletem" : inviteOnly ? "Belépés meghívóval" : "Elkészítem a képletem"; + const start = loggedIn ? "/keplet" : "/belepes"; return (
- + {!loggedIn && }
@@ -69,26 +71,26 @@ export function Landing({ inviteOnly }: { inviteOnly: boolean }) { árának töredékéért.

- + {signIn} Példaelemzés
-

- Ingyenes - Nézd meg a születési horoszkópodat belépés nélkül → -

-

- {inviteOnly ? ( - <> - Az oldal egyelőre meghívásos: meghívóval, Google-fiókkal lépsz be. - - ) : ( - "A képlet és a rövid összefoglaló ingyenes. Google-fiókkal lépsz be." - )} -

+ {!loggedIn && ( +

+ Ingyenes + Nézd meg a születési horoszkópodat belépés nélkül → +

+ )} + {!loggedIn && ( +

+ {inviteOnly + ? "Az oldal egyelőre meghívásos: meghívóval, Google-fiókkal lépsz be." + : "A képlet és a rövid összefoglaló ingyenes. Google-fiókkal lépsz be."} +

+ )}
@@ -124,7 +126,7 @@ export function Landing({ inviteOnly }: { inviteOnly: boolean }) {
Ingyenes

- Belépés nélkül is kipróbálhatod + {loggedIn ? "Ingyenes eszközök" : "Belépés nélkül is kipróbálhatod"}

@@ -467,11 +469,13 @@ export function Landing({ inviteOnly }: { inviteOnly: boolean }) {

Kíváncsi vagy, mit mutat a te képleted?

- {inviteOnly - ? "Egyelőre meghívással lehet csatlakozni. Ha kaptál meghívót, lépj be a Google-fiókoddal." - : "Két perc, és ott a képleted a rövid összefoglalóval együtt."} + {loggedIn + ? "A képleted, az elemzéseid és az összevetéseid egy kattintásra." + : inviteOnly + ? "Egyelőre meghívással lehet csatlakozni. Ha kaptál meghívót, lépj be a Google-fiókoddal." + : "Két perc, és ott a képleted a rövid összefoglalóval együtt."}

- + {signIn}

@@ -499,7 +503,7 @@ export function Landing({ inviteOnly }: { inviteOnly: boolean }) { Példajóslás ÁSZF Adatvédelem - Belépés + {!loggedIn && Belépés} © {new Date().getFullYear()} Sorsfonalak

diff --git a/services/frontend/src/app/belepes/page.tsx b/services/frontend/src/app/belepes/page.tsx index 41b8291..720b922 100644 --- a/services/frontend/src/app/belepes/page.tsx +++ b/services/frontend/src/app/belepes/page.tsx @@ -22,7 +22,8 @@ export const metadata: Metadata = { title: "Belépés" }; */ function safeTarget(value: string | string[] | undefined): string { const v = Array.isArray(value) ? value[0] : value; - return v && /^\/(?![/\\])[^\\\u0000-\u001f]*$/.test(v) ? v : "/"; + // By default to the user's chart (or to the profile for their birth data). + return v && /^\/(?![/\\])[^\\\u0000-\u001f]*$/.test(v) ? v : "/keplet"; } async function loadConfig(): Promise { diff --git a/services/frontend/src/app/jelszo/SetPasswordForm.tsx b/services/frontend/src/app/jelszo/SetPasswordForm.tsx index 7679492..3aa7c81 100644 --- a/services/frontend/src/app/jelszo/SetPasswordForm.tsx +++ b/services/frontend/src/app/jelszo/SetPasswordForm.tsx @@ -29,7 +29,7 @@ export function SetPasswordForm({ token, minLength }: { token: string; minLength setBusy(true); try { await api("/auth/set-password", { body: { token, password } }); - router.replace("/"); + router.replace("/keplet"); router.refresh(); } catch (err) { if (err instanceof ApiError && err.code === "invalid_token") setExpired(true); diff --git a/services/frontend/src/app/page.tsx b/services/frontend/src/app/page.tsx index 62c77b3..b279097 100644 --- a/services/frontend/src/app/page.tsx +++ b/services/frontend/src/app/page.tsx @@ -1,5 +1,4 @@ import type { Metadata } from "next"; -import { redirect } from "next/navigation"; import { JsonLd } from "@/components/PublicFooter"; import { OPERATOR } from "@/lib/legal"; @@ -42,14 +41,13 @@ async function signupMode(): Promise { } } -/** Visitors get the home page; logged-in users go to their chart (or to the profile for their birth data). */ +/** The home page, for visitors and logged-in users alike (they get the app's header and a link to their chart). */ export default async function Home() { const me = await getMe(); - if (me) redirect(me.primary_chart_id ? "/keplet" : "/profil"); const base = await siteUrl(); return ( <> - +