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:
@@ -24,10 +24,13 @@ function loginError(e: unknown): string {
|
||||
export function PasswordLogin({
|
||||
target,
|
||||
inviteToken = null,
|
||||
referral = null,
|
||||
initialMode = "login",
|
||||
}: {
|
||||
target: string;
|
||||
inviteToken?: string | null;
|
||||
/** The shared link the visitor came from (in the login link: `?ref=`), for the sharer's reward. */
|
||||
referral?: string | null;
|
||||
initialMode?: Mode;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
@@ -60,12 +63,6 @@ export function PasswordLogin({
|
||||
return;
|
||||
}
|
||||
if (mode === "register") {
|
||||
let referral: string | null = null;
|
||||
try {
|
||||
referral = localStorage.getItem("sf_ref");
|
||||
} catch {
|
||||
// storage blocked
|
||||
}
|
||||
await api("/auth/register", {
|
||||
body: { email, display_name: name.trim() || null, locale: "hu", invite_token: inviteToken, referral },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user