/** * The email a person has typed during sign-in, kept so the next auth screen opens with it filled. * * Sign-in, "use a code instead", "forgot password" and "create account" are separate screens, and * each one used to start with an empty email field. Someone who typed their address, then chose * another way in, typed it again. The fix is the same everywhere, so it lives here once. * * ```tsx * rememberAuthEmail(event.currentTarget.value)} /> * ``` * * - **Not in the URL.** A query string rides in `Referer`, in access logs, in history and in every * analytics tool that records page addresses. An email is personal data and has no business there. * - **`localStorage`, not `sessionStorage`.** An emailed link opens in a new tab, and a new tab * does not inherit `sessionStorage`. The person who confirms their account from the mail lands * on sign-in in that new tab, which is the screen that most needs the address. * - **Thirty minutes, sliding.** Long enough to read a code in a mail client and come back; short * enough that a shared computer forgets. Every keystroke renews it, and a value found expired is * deleted when it is read, so it does not sit on disk afterwards. * - **Memory behind it.** A browser that blocks site data throws on `localStorage` itself, and * React Native has none. The value then lasts until the page (or the app) is left, which still * covers moving between screens. * * Read it once when a screen opens, as a default value. It is not a live store: nothing re-renders * when it changes, and a prerendered page must read it after hydration, never while rendering. * Never put a password, a code or a token here. Call `forgetAuthEmail()` once a session exists, so * the next person at this browser starts empty. */ /** The address typed earlier in this sign-in, or an empty string when there is none. */ export declare function recallAuthEmail(): string; /** * Keep what the person has typed. Call it from the email field's change handler, so every screen * they reach next can open with it. The value is stored as typed: trim it where you submit it. * An empty value forgets. */ export declare function rememberAuthEmail(value: string): void; /** Drop it. Call this once a session exists, so the next person at this browser starts empty. */ export declare function forgetAuthEmail(): void; //# sourceMappingURL=auth-email.d.ts.map