Repository navigation
Conversation
📊 Build Bundle StatsThe latest build generated the following assets: |
|
✅ No security or compliance issues detected. Reviewed everything up to c084f78. Security OverviewDetected Code Changes
|
There was a problem hiding this comment.
🟡 Changes recommended
Restarting an in-progress login can retain iiAnswered: true, hiding the recovery prompt if the replacement popup closes prematurely.
1 open issue
What changed in this PR
This PR hides the Internet Identity reopen prompt once authentication reaches the delegation stage, preventing unnecessary login restarts while preserving the overlay layout.
Changes:
- Tracks
iiAnsweredin auth state and exposesisFinishingLogin. - Hides the recovery prompt while login finishes, retaining its space.
- Adds tests for the auth signal, failure reset, and prompt visibility.
| File | Description |
|---|---|
src/governance-app-frontend/src/routes/index.tsx |
Passes login completion state to the recovery prompt. |
src/governance-app-frontend/src/features/login/components/LoginRestart.tsx |
Hides the prompt while login finishes without shifting layout. |
src/governance-app-frontend/src/features/login/components/LoginRestart.spec.tsx |
Tests delayed visibility and finishing-state hiding. |
src/governance-app-frontend/src/common/hooks/useInternetIdentity.ts |
Exposes isFinishingLogin to components. |
src/governance-app-frontend/src/common/auth/internetIdentity.ts |
Records the first auth-agent fetch during login. |
src/governance-app-frontend/src/common/auth/internetIdentity.test.ts |
Tests the fetch signal and its reset after failure. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
A late fetch from a replaced client can mark the replacement login as answered and prematurely hide its recovery prompt, so the callback needs a client-generation guard and a regression test.
1 open issue
1 resolved since last review
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Mocked tests cannot establish that the real auth SDK waits for II’s response before agent requests, including local root-key fetching and client replacement, leaving login-recovery ordering unverified.
No open issues 🎉
1 resolved since last review
Review effort: Balanced

Motivation
With auth 10, the II window closes before the first delegation exists, so the app waits about 1 s on the "Authenticating" overlay. The "Closed the window? Open Internet Identity again" prompt appears 3 s after the click, so it is on screen for that whole wait, after II succeeded. A click restarts a login that is almost done.
Changes
iiAnsweredto the auth state. The first agent call of a login sets it.isFinishingLogintouseInternetIdentity.LoginRestartonce II answered. Its space stays, so the logo does not move.Screenshots