Skip to content

feat: add connectAccountWithRedirect method to AuthService#767

Merged
yogeshchoudhary147 merged 4 commits intomainfrom
feat/connect-account-with-redirect
Jan 12, 2026
Merged

feat: add connectAccountWithRedirect method to AuthService#767
yogeshchoudhary147 merged 4 commits intomainfrom
feat/connect-account-with-redirect

Conversation

@yogeshchoudhary147
Copy link
Contributor

@yogeshchoudhary147 yogeshchoudhary147 commented Jan 12, 2026

Description

Adds support for the connectAccountWithRedirect() method to auth0-angular, exposing the Connect Account functionality already available in auth0-spa-js.

Changes

  • ✨ Added connectAccountWithRedirect() method to AuthService that wraps the auth0-spa-js client method
  • 📤 Exported RedirectConnectAccountOptions type from public-api.ts
  • 📝 Added Connect Accounts usage example to EXAMPLES.md with configuration and implementation details
  • ✅ Added unit tests for the new method with mock setup and test cases

Motivation

The connectAccountWithRedirect() method is available in auth0-spa-js but was not exposed in auth0-angular. This prevented Angular customers from using the Connect Account flow with MRRT (Multi-Refresh Token Rotation).

Without this method, customers were forced to use silent login (iframe-based) as a workaround, which fails in Safari and other browsers with strict third-party cookie policies.

Implementation Details

  • Follows the same Observable-based pattern as loginWithRedirect()
  • Returns Observable<void> consistent with other redirect methods
  • The existing handleRedirectCallback() method already supports ConnectAccountRedirectResult, so no additional changes needed for callback handling
  • Method includes comprehensive JSDoc documentation with examples

Testing

  • Added unit tests that verify the method calls the underlying auth0-spa-js client
  • Tests cover both basic usage and all optional parameters (scopes, authorization_params, redirectUri, appState, openUrl)

- Add connectAccountWithRedirect() method to AuthService
- Export RedirectConnectAccountOptions type from public-api.ts
- Exposes existing auth0-spa-js functionality to Angular SDK
@yogeshchoudhary147 yogeshchoudhary147 requested a review from a team as a code owner January 12, 2026 03:57
EXAMPLES.md Outdated
- [Handling errors](#handling-errors)
- [Organizations](#organizations)
- [Standalone Components and a more functional approach](#standalone-components-and-a-more-functional-approach)
- [Connect Accounts](#connect-accounts)
Copy link
Contributor

Choose a reason for hiding this comment

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

We can call this Connect Accounts for using Token Vault

@yogeshchoudhary147 yogeshchoudhary147 merged commit 5239370 into main Jan 12, 2026
8 of 9 checks passed
@yogeshchoudhary147 yogeshchoudhary147 deleted the feat/connect-account-with-redirect branch January 12, 2026 13:37
This was referenced Jan 13, 2026
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