fix(elements): add restart button when flow state has error#2580
Open
d02ev wants to merge 1 commit intoteamhanko:mainfrom
Open
fix(elements): add restart button when flow state has error#2580d02ev wants to merge 1 commit intoteamhanko:mainfrom
d02ev wants to merge 1 commit intoteamhanko:mainfrom
Conversation
When a user's session expires during a login flow (e.g., flow_expired_error), they now see a 'Restart' button to reload the login state instead of being stuck with no way to recover. - Modified Form.tsx to accept optional fallbackLabel and onFallbackClick props - Added onRestartClick handler in LoginInitPage to restart the login flow - Shows restart button when flowState.error?.code is present - Added 'restart' translation key in all 8 languages (en, de, fr, zh, bn, pt-BR, nl, it) Fixes: teamhanko#2487
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
When a user's session expires during a login flow (e.g.,
flow_expired_error), they now see a 'Restart' button to reload the login state instead of being stuck with no way to recover.Problem
In issue #2487, users reported that when their session expires during a login flow (e.g., entering email, waiting for session to expire, then clicking back), they see an error message but no way to restart or reload the flow. The issue is in
Form.tsx- it doesn't render anything whenflowActionis not enabled, leaving users stuck.Solution
Form.tsx(frontend/elements/src/components/form/Form.tsx):fallbackLabelandonFallbackClickpropsLoginInitPage.tsx(frontend/elements/src/pages/LoginInitPage.tsx):onRestartClickcallback that callsinit("login")to restart the flowflowState.error?.code)Why This Works
flow_expired_error: "The session has expired, please click the button to restart.") - this fix provides the button the message refers toFixes #2487