Skip to content

Add onError callback before error redirect in SignIn flow. - #97

Merged
brionmario merged 1 commit into
thunder-id:mainfrom
Infosys:fix/2469
Sep 11, 2026
Merged

Add onError callback before error redirect in SignIn flow.#97
brionmario merged 1 commit into
thunder-id:mainfrom
Infosys:fix/2469

Conversation

@SajidMannikeri17

@SajidMannikeri17 SajidMannikeri17 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Purpose

Fire the onError callback before redirecting back to the relying party on a terminal error response. This lets consuming apps run teardown (e.g. clearing a window.onbeforeunload tab-close guard) before the browser unloads, preventing a stray "Leave site?" dialog on error redirects such as consent denial or timeout.

Approach

In SignIn's handleTerminalResponse, invoke onError?.(...) synchronously in the error branch that has a redirectUrl, immediately before setting window.location.href. Previously onError never fired on this path.

Related Issues

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards.
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Signed-off-by: SajidMannikeri17 <sajid.mannikeri@infosys.com>
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 2977a9d4-dcef-48e6-a512-242dc0186e16


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.

@brionmario
brionmario merged commit b72c77d into thunder-id:main Sep 11, 2026
7 checks passed
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