No browser storage for referrals; the birth chart opens at the drawn chart
The share page stores nothing in the browser any more: the shared link that brought a visitor travels in its login link (/belepes?ref=...) to the Google, Apple and password sign-up. The backend counts the same visitor of a link once in half an hour, instead of a sessionStorage flag. The public birth chart scrolls to the drawn chart after a calculation and when coming back to the page. Tabs scrolled to themselves on every re-render of their parent when the address had a tab (#bolygok); they now react only to the tab ids and hash changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -101,6 +101,9 @@ export default async function LoginPage({ searchParams }: { searchParams: Promis
|
||||
const clientId = config?.google_login.enabled ? config.google_login.client_id : null;
|
||||
const appleId = config?.apple_login?.enabled ? config.apple_login.client_id : null;
|
||||
const pendingInvite = invitation?.status === "pending" ? inviteToken : null;
|
||||
// The shared link that brought the visitor (from its login button), for the sharer's reward.
|
||||
const rawRef = Array.isArray(params.ref) ? params.ref[0] : params.ref;
|
||||
const referral = rawRef && /^[A-Za-z0-9_-]{4,64}$/.test(rawRef) ? rawRef : null;
|
||||
const inviteOnly = config?.signup_mode === "invite";
|
||||
const password = config?.password_login === true;
|
||||
const mod = Array.isArray(params.mod) ? params.mod[0] : params.mod;
|
||||
@@ -139,8 +142,10 @@ export default async function LoginPage({ searchParams }: { searchParams: Promis
|
||||
<>
|
||||
{clientId && (
|
||||
<div className="field" style={{ gap: 12 }}>
|
||||
<GoogleLogin clientId={clientId} target={target} inviteToken={pendingInvite} />
|
||||
{appleId && <AppleLogin clientId={appleId} target={target} inviteToken={pendingInvite} />}
|
||||
<GoogleLogin clientId={clientId} target={target} inviteToken={pendingInvite} referral={referral} />
|
||||
{appleId && (
|
||||
<AppleLogin clientId={appleId} target={target} inviteToken={pendingInvite} referral={referral} />
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{clientId && password && (
|
||||
@@ -148,7 +153,9 @@ export default async function LoginPage({ searchParams }: { searchParams: Promis
|
||||
<span>vagy</span>
|
||||
</div>
|
||||
)}
|
||||
{password && <PasswordLogin target={target} inviteToken={pendingInvite} initialMode={initialMode} />}
|
||||
{password && (
|
||||
<PasswordLogin target={target} inviteToken={pendingInvite} referral={referral} initialMode={initialMode} />
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
<p className="msg msg-error" role="alert">
|
||||
|
||||
Reference in New Issue
Block a user