GeezerVison is showing github.com — fix: show success after email 2FA activation by shazia-k · Pull Request #535 · OpenResilienceInitiative/ORISO-Frontend
Conversation
shazia-k
commented
Jul 19, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
What changed
- Treat the immediate user-data refresh as best-effort after the backend has successfully activated a 2FA credential.
- Show the correct App or E-mail success step even when the current login token still contains stale account data.
- Preserve the parent refresh-failure notification without misreporting the already-successful OTP confirmation.
- Add regression coverage for stale refreshes after both E-mail and App activation.
Root cause
The live E-mail flow successfully validated the code and switched the Keycloak credential to E-mail. The subsequent reloadUserData() call failed or returned stale data because the current session still represented the previous account e-mail. The setup dialog treated that secondary refresh problem as an OTP confirmation failure, leaving users on the code screen even though 2FA had already changed.
User impact
After a valid E-mail code is accepted, users now see the success screen. Updated account data is picked up normally after the session refresh/next login.
Validation
TwoFactorSetupDialog.test.tsx: 9/9 tests passed.
- ESLint, Prettier, and
git diff --check passed for both changed files.
- Full repository gates were attempted. They remain blocked by unrelated checkout/repository issues: missing installed OpenTelemetry/Joyride/TipTap packages, existing
localStorage test-environment failures, and dependency resolution conflict between React 19 and @cypress/react during npm ci.
Summary by CodeRabbit
- Bug Fixes
- Improved two-factor authentication setup behavior when account information refreshes fail after activation.
- Setup now continues to the appropriate success confirmation instead of displaying an incorrect setup error.
- Ensures setup-aborted handling is triggered consistently in these scenarios.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Jul 19, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 98de76f7-e174-4dce-ba94-e6603919c1fb
📥 Commits
Reviewing files that changed from the base of the PR and between 4ec3f55 and 4e322ed.
📒 Files selected for processing (2)
src/components/twoFactorAuth/TwoFactorSetupDialog.test.tsx
src/components/twoFactorAuth/TwoFactorSetupDialog.tsx
📜 Recent review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: lint, type-check, test, build and Docker validation
- GitHub Check: lint, type-check, build and Storybook Docker validation
- GitHub Check: lint, type-check and build frontend
- GitHub Check: lint, type-check, build and test frontend
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: Keep shared behavior in hooks/utilities when multiple screens need the same state, route, selection, or formatting logic.
UI changes must have accessible focus/keyboard behavior and must not rely on color alone.
Files:
src/components/twoFactorAuth/TwoFactorSetupDialog.tsx
src/components/twoFactorAuth/TwoFactorSetupDialog.test.tsx
**/*.{scss,sass,css,ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Reuse existing design tokens, Sass mixins, and component patterns; avoid one-off hardcoded CSS for controls, active list states, focus rings, and responsive layout.
Files:
src/components/twoFactorAuth/TwoFactorSetupDialog.tsx
src/components/twoFactorAuth/TwoFactorSetupDialog.test.tsx
src/**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
src/**/*.{ts,tsx,js,jsx}: Check behavior against the surrounding ORISO flow, not only types.
Flag duplicated route/state logic, missing error/loading handling,
privacy regressions around Matrix/chat/drafts, and changes that should
be expressed through shared hooks or utilities instead of local flags.
Files:
src/components/twoFactorAuth/TwoFactorSetupDialog.tsx
src/components/twoFactorAuth/TwoFactorSetupDialog.test.tsx
🔇 Additional comments (2)
src/components/twoFactorAuth/TwoFactorSetupDialog.tsx (1)
311-335: LGTM!
Also applies to: 377-377, 400-400
src/components/twoFactorAuth/TwoFactorSetupDialog.test.tsx (1)
491-522: LGTM!
Also applies to: 553-553, 575-580
📝 Walkthrough
Walkthrough
TwoFactorSetupDialog now treats post-activation completion refresh failures as non-fatal: it invokes onSetupAborted when available, advances to the relevant success step, and suppresses setup errors. Tests cover the email and app flows.
Changes
Two-factor setup completion
| Layer / File(s) |
Summary |
Non-fatal setup completion handling src/components/twoFactorAuth/TwoFactorSetupDialog.tsx |
finishSetup handles completion failures without setting error state, notifies onSetupAborted, and advances app and email flows to their success steps. |
Refresh-failure behavior tests src/components/twoFactorAuth/TwoFactorSetupDialog.test.tsx |
Tests verify success-step rendering, abort-callback invocation, and suppression of setup errors after refresh failures. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Sequence Diagram(s)
sequenceDiagram
participant ActivationFlow
participant TwoFactorSetupDialog
participant onSetupComplete
participant onSetupAborted
ActivationFlow->>TwoFactorSetupDialog: activate app or email setup
TwoFactorSetupDialog->>onSetupComplete: complete setup
onSetupComplete-->>TwoFactorSetupDialog: success or STALE_USER_DATA rejection
TwoFactorSetupDialog->>onSetupAborted: notify abort on rejection
TwoFactorSetupDialog-->>ActivationFlow: advance to success step
Loading
Suggested labels: coderabbit
Suggested reviewers: storypapst
🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
| Check name |
Status |
Explanation |
| Description Check |
✅ Passed |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
✅ Passed |
The title is concise, conventional, and clearly matches the email 2FA activation success handling change. |
| Docstring Coverage |
✅ Passed |
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check |
✅ Passed |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
✅ Passed |
Check skipped because no linked issues were found for this pull request. |
| Validation Evidence |
✅ Passed |
Behavior-changing code is covered by new regression tests, and the PR description lists exact validation results including 9/9 tests passed. |
| Shared Ui Architecture |
✅ Passed |
PASS: The PR only refactors 2FA completion logic and tests; no new UI primitive or duplicate interaction pattern was introduced, and it reuses existing MUI/helpers. |
✨ Finishing Touches
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
fix/email-2fa-success-sync
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jul 20, 2026
This was referenced Jul 28, 2026
This was referenced Aug 1, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|