Skip to content

feat: add connected accounts callback handling#817

Merged
yogeshchoudhary147 merged 4 commits intomainfrom
feat/connected-accounts-callback-handling
Feb 25, 2026
Merged

feat: add connected accounts callback handling#817
yogeshchoudhary147 merged 4 commits intomainfrom
feat/connected-accounts-callback-handling

Conversation

@yogeshchoudhary147
Copy link
Copy Markdown
Contributor

@yogeshchoudhary147 yogeshchoudhary147 commented Feb 16, 2026

Screen.Recording.2026-02-21.at.6.04.32.PM.mov

Description

Completes the Connected Accounts implementation started in #767. Previously the SDK could initiate the connect flow but couldn't process the response when users returned from connecting their account. This PR adds the missing callback logic.

Changes

  • Add callback handling for the connected accounts redirect flow
  • Expose connected account details via appState$ after redirect completes
  • Export related types: ConnectedAccount, ResponseType, ConnectError, ConnectAccountRedirectResult
  • Update EXAMPLES.md with callback handling and listing connected accounts examples

Note

The SPA SDK's role in Token Vault covers the Connected Accounts flow: initiating and completing account connections and managing them via the My Account API. Actual token retrieval from Token Vault requires a confidential backend client.

Testing

4 new tests added, 131 total passing. E2E flow verified (see demo above).

@yogeshchoudhary147 yogeshchoudhary147 requested a review from a team as a code owner February 16, 2026 14:01
@yogeshchoudhary147 yogeshchoudhary147 force-pushed the feat/connected-accounts-callback-handling branch 5 times, most recently from 8f3a71e to 4b86caa Compare February 23, 2026 12:00
- Add ConnectedAccount type and update AppState interface
- Export ResponseType, ConnectError, and ConnectAccountRedirectResult
- Update handleRedirectCallback to extract connected account data
- Add connect_code parameter detection in shouldHandleCallback
- Add comprehensive test coverage for callback handling
- Update documentation with connected accounts usage examples
@yogeshchoudhary147 yogeshchoudhary147 force-pushed the feat/connected-accounts-callback-handling branch from 4b86caa to d63825a Compare February 23, 2026 12:03
appState.connectedAccount = rest as ConnectedAccount;
}

if (appState) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yogeshchoudhary147 On line number 398, we have added
appState.response_type = response_type;

This will always make the appState always truthy, even for non-connected account flow.
Will that not cause side effects ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Removed the {} default so we no longer emit to appState$ when no appState was provided in a regular login flow.

@yogeshchoudhary147 yogeshchoudhary147 merged commit a321bfa into main Feb 25, 2026
9 checks passed
@yogeshchoudhary147 yogeshchoudhary147 deleted the feat/connected-accounts-callback-handling branch February 25, 2026 09:30
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