Skip to content

Commit f32979d

Browse files
os-zhuangclaude
andauthored
fix(app-shell): don't show the recovery-password reminder on a user's first landing (#2183)
The RecoveryPasswordReminder banner ("Set a recovery password so you can still sign in if SSO is ever unavailable") fired on the env home whenever an SSO user had no local password — including a brand-new user's very first screen, before they've built anything. Premature: it loads the first-run magic moment with a resilience nudge the user has no reason to care about yet. (The component's own comment already intends "not before the first session"; the code didn't honor it.) Gate on a first-visit marker: record the first home landing, show the reminder only from the next visit onward. Still dismissible; still SSO-fallback resilience for the default (password-allowed) envs. Follow-up: the reminder also shows on SSO-enforced envs where password login is disabled (recovery password unusable there) — that gate is separate. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 17374ce commit f32979d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

packages/app-shell/src/console/home/HomePage.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,15 @@ function RecoveryPasswordReminder({ t }: { t: (key: string, opts?: any) => strin
188188
const [show, setShow] = useState(false);
189189
useEffect(() => {
190190
if (typeof localStorage !== 'undefined' && localStorage.getItem('os:recovery-pw-dismissed') === '1') return;
191+
// Don't nag on the very first landing: let a brand-new SSO user reach
192+
// their magic moment (build their first app) before asking them to set a
193+
// recovery password. Record the first home visit; show the reminder only
194+
// from the next one on. (The component already intends 'not before the
195+
// first session'; previously the code still fired on the very first screen.)
196+
if (typeof localStorage !== 'undefined' && localStorage.getItem('os:recovery-pw-first-seen') !== '1') {
197+
try { localStorage.setItem('os:recovery-pw-first-seen', '1'); } catch { /* ignore */ }
198+
return;
199+
}
191200
let cancelled = false;
192201
Promise.resolve(hasLocalPassword?.())
193202
.then((has) => { if (!cancelled && has === false) setShow(true); })

0 commit comments

Comments
 (0)