Skip to content

IS-11347 Unify completed-with-success and completed-with-error handling#196

Draft
aleixsuau wants to merge 1 commit into
integration/IS-5161/login-web-appfrom
feature/IS-5161/IS-11347-unify-completed-step-handling
Draft

IS-11347 Unify completed-with-success and completed-with-error handling#196
aleixsuau wants to merge 1 commit into
integration/IS-5161/login-web-appfrom
feature/IS-5161/IS-11347-unify-completed-step-handling

Conversation

@aleixsuau
Copy link
Copy Markdown
Contributor

Jira: https://curity.atlassian.net/browse/IS-11347

Summary

Unifies completed-with-success and completed-with-error HAAPI step handling under a single handleCompletedStep with one config knob — autoRedirectOnAuthenticationComplete. Previously the LWA auto-redirected on success but exposed errors as nextStepData, even though both server-side step shapes carry an authorization-response link and the Velocity-rendered UI auto-redirects in both cases.

Config

autoRedirectOnAuthenticationComplete: boolean | AUTO_REDIRECT_ON_AUTHENTICATION_COMPLETE (default true).

  • true → redirect on both success and error
  • false → expose the completed step as nextStepData for both
  • 'ONLY_ON_SUCCESS' → redirect on success, expose on error
  • 'ONLY_ON_ERROR' → redirect on error, expose on success

Breaking rename of redirectOnAuthenticationCompletedWithSuccess — safe because the LWA is still pre-1.0 and has no external consumers.

Test plan

  • CI green (tsc, eslint, vitest, prettier)
  • Manually verify: HAAPI flow ending in completed-with-error (e.g. unknown client_id) auto-redirects under default config
  • Manually verify: autoRedirectOnAuthenticationComplete: 'ONLY_ON_SUCCESS' causes the error step to surface as nextStepData
  • Manually verify: existing success flow still redirects (no regression)

Merges both terminal OAuth response steps under a single `handleCompletedStep`
with one config knob: `autoRedirectOnAuthenticationComplete`. Default `true`
(auto-redirect both); accepts `false`, `'ONLY_ON_SUCCESS'`, `'ONLY_ON_ERROR'`
for finer control. Replaces `redirectOnAuthenticationCompletedWithSuccess`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant