Skip to content

fix: account page reauth UX, narrow-screen overflow, signout cleanup - #989

Merged
nimish-ks merged 9 commits into
feat--user-auth-managementfrom
feat--user-auth-management-misc-fixes-improv
Aug 27, 2026
Merged

fix: account page reauth UX, narrow-screen overflow, signout cleanup#989
nimish-ks merged 9 commits into
feat--user-auth-managementfrom
feat--user-auth-management-misc-fixes-improv

Conversation

@nimish-ks

Copy link
Copy Markdown
Member

🔍 Overview

Stacked on top of #983 — base branch is feat--user-auth-management, so review that first. This is follow-up UX polish from testing the account page locally.

Frontend only. No backend, schema, migration, or dependency changes.

💡 Proposed Changes

Prompt-first re-authentication

Reauth-gated dialogs used to open with a "You'll be asked to confirm it's you before this change is applied" notice inside them, and the sign-in prompt only appeared at submit. The freshness check now runs at click time instead, so the "Confirm it's you" prompt comes first and the user continues the flow normally after re-login.

  • Applied the pre-check pattern already used by Enable 2FA and Link provider to the remaining sensitive flows: change email, manage 2FA (regenerate / disable), unlink provider, delete account
  • Removed StaleSessionNotice.tsx — the prompt now does its job
  • Delete account: dropped the requiresReauth button swap ("Sign in again to continue" vs "Delete account"). That flag is a load-time snapshot, so a session going stale while the page sat open still rendered the delete button and dead-ended at submit; the click-time isFresh() check catches that case
  • No backend change — require_fresh_session_graphql on the mutations is still the actual enforcement. This only moves when the user is asked

Login page reauth banner

  • Restyled the ?reauth=1 banner from a low-contrast cyan Alert one-liner into an amber panel with a "Confirm it's you" heading, reusing the icon and tokens from the dialog the user just came from
  • Removed the toast that fired at the same moment saying the same thing

Narrow-screen fixes

  • License card: long UUIDs no longer overflow (min-w-0 on the flex child so it can shrink, plus break-all)
  • 2FA manage dialog: Regenerate / Disable buttons no longer compress (shrink-0)
  • Delete account button: same

Navigation

  • Account page "Back home" → "Back to settings", now pointing at the org settings Account & Security tab. Built from activeOrganisation.name rather than a hardcoded slug, falling back to / when there's no active org

Signout cleanup

  • graphQlClient.stop() at the top of handleSignout(), stopping polling and in-flight queries before the logout round trip. Without it, GetOrganisations (10s poll) can fire against an already-invalidated session and 403 — visible after account deletion. Nothing user-facing was broken (Django's HTML 403 lands in Apollo's networkError branch, which doesn't toast), but it removes the log noise and a redundant second logout call

📝 Release Notes

  • Improved: You're asked to confirm your identity up front when starting a sensitive account change, rather than partway through it.
  • Fixed: Long license IDs and action buttons no longer overflow on narrow screens.

🎯 Reviewer Focus

  • DeleteAccountSection.tsx — the requiresReauth removal is the only change with a server-side counterpart. The mutation gate is untouched; this is purely about when the UI asks.
  • apollo/client.ts — one line, but it's shared plumbing on every signout path (manual logout, session expiry, deletion).

🧪 Testing

Manual only; no test changes. Verified against the local dev stack in cloud mode — each of the five gated flows (email change, 2FA setup, 2FA manage, unlink, delete) shows the prompt on a stale session and restores correctly after re-login.

@nimish-ks nimish-ks self-assigned this Aug 27, 2026
@nimish-ks
nimish-ks marked this pull request as ready for review August 27, 2026 06:53
@rohan-chaturvedi
rohan-chaturvedi force-pushed the feat--user-auth-management-misc-fixes-improv branch from 9e67116 to 95d9a01 Compare August 27, 2026 10:35
@nimish-ks
nimish-ks merged commit 6ea8fed into feat--user-auth-management Aug 27, 2026
15 checks passed
@nimish-ks
nimish-ks deleted the feat--user-auth-management-misc-fixes-improv branch August 27, 2026 10:56
nimish-ks added a commit that referenced this pull request Aug 29, 2026
…e management (#983)

* feat: user account management — auth provider linking, TOTP 2FA, email change, and account deletion

* fix: keep TOTP verify button disabled through post-verify redirect, simplify setup copy

* fix: add TOTP manage dialog, button icons, hover-reveal unlink and clearer copy on account page

* fix: gate email-change password proof on has_usable_password instead of session auth method

* fix: allow soft-deleting service account tokens whose creator account was deleted

* feat: show deleted-account actors consistently in audit logs and token lists

* fix: keep App-level service tokens usable after their creator account is deleted

* fix: harden post-login redirect validation and make re-login session freshness TOTP-aware

* refactor: drop redundant sole-SA-handler warning from deletion readiness — a sole handler is only possible as sole owner, which already blocks

* fix: split user menu into account, org and session sections and autofocus 2FA code inputs

* fix: tolerate fast TOTP clocks in the replay guard, lock the user row during the email-change ceremony, reject blank display names and refresh cached org data after account changes

* fix: size user menu settings buttons to their content instead of full width

* feat: group account sign-in methods by organisation and label org-level linked identities

* fix: show the account name and an org icon in the unlink dialog and sign-in method cards

* refactor: move identity and MFA management from REST to GraphQL, keeping only pre-login TOTP verify on REST

* fix: show a single owned toast per account-page error and never surface the raw reauth code

* fix: size the TOTP verify button to its content instead of full width

* fix: harden account-management flows from pre-ship review (SSO uid guard, deletion races, SCIM/TOTP, shared helpers)

* fix: scope reauth sign-in options to linked methods and centralize reauth error handling

* feat: move manage account button below the user context

* feat: 2fa icon

* feat: improve account recovery note clarity

* feat: add a icon to change password button

* feat: offer the same SSO providers on the account page as the login page

* fix: skip no-op display name saves on the account page

* feat: restore interrupted account flows after re-auth with a confirm-first prompt

* feat: link user menu profile and org cards to account and org settings

* feat: give the warning text some more room. increased padding

* feat: improve padding of the icons nin the social and 2fa sections

* feat: improve confirm it's you UX

* feat: reanme the account management subtitle

* fix: the App setting tab's UI and padding

* feat: rename to account & srcurity

* feat: simplify personal account management description

* feat: "use a recovery code - instead"

* feat: gate the user on session reauth before taking sensitive action for simplicity

* feat: remove the annoying signin to continue toast

* feat: improve the confirm it's you message

* fix-ui: uuid text overflow on narrower width

* feat: send the user to account settings instead of home

* fix-ui: test overflow on narrower screens

* fix: preemptively gate the account delete

* fix: stop the graphql client after user logout

* fix: exempt invite acceptance from org SSO enforcement for invite holders

* fix: review fixes for reauth UX — back-link label, signout hardening, useReauthGuard consolidation

* fix: account page reauth UX, narrow-screen overflow, signout cleanup (#989)

* feat: gate the user on session reauth before taking sensitive action for simplicity

* feat: remove the annoying signin to continue toast

* feat: improve the confirm it's you message

* fix-ui: uuid text overflow on narrower width

* feat: send the user to account settings instead of home

* fix-ui: test overflow on narrower screens

* fix: preemptively gate the account delete

* fix: stop the graphql client after user logout

* fix: review fixes for reauth UX — back-link label, signout hardening, useReauthGuard consolidation

---------

Co-authored-by: rohan <rohan.chaturvedi@protonmail.com>

* fix: keep onboarding navbar below dialog overlays

* fix: validate OIDC issuer at config save and surface authorize errors as safe redirect codes

* fix: map SSO error codes to friendly copy on the login page

---------

Co-authored-by: Nimish <85357445+nimish-ks@users.noreply.github.com>
Co-authored-by: Nimish <nimish@phase.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants