Skip to content

Add referrer redirect support to OIDC auth completion (v1.3.0)#15

Merged
Omerisra6 merged 3 commits intomasterfrom
feature/oauth-referrer-redirect
Feb 26, 2026
Merged

Add referrer redirect support to OIDC auth completion (v1.3.0)#15
Omerisra6 merged 3 commits intomasterfrom
feature/oauth-referrer-redirect

Conversation

@Omerisra6
Copy link
Copy Markdown
Collaborator

@Omerisra6 Omerisra6 commented Feb 26, 2026

Summary

  • After OIDC authentication completes, the SDK now checks for a stored referrer redirect (getReferrerRedirect())
  • If redirect data exists, navigates to the stored URL with optional #angie-prompt= hash parameter, then clears the redirect
  • If no redirect data exists, opens the sidebar as before (no behavior change for existing flows)
  • Bumps version to 1.3.0

Context

This is part of AI-6561 (Add support for prompt when setting redirect referrer). The previous PR (#13) added prompt support to the setReferrerRedirect/getReferrerRedirect utilities. This PR wires that into the actual auth completion callback so redirects happen after OIDC login.

The ai-remote-integration package in elementor-ai had a post-activation-redirect.ts that was supposed to handle this, but it relied on a ANGIE_USER_ALREADY_AUTHENTICATED postMessage that is no longer sent in the OIDC flow — making it dead code. Moving the redirect logic into the SDK's onAuthenticationComplete callback is the correct integration point.

Test plan

  • 6 unit tests added covering: listener setup, sidebar open (no redirect), redirect with prompt, redirect without prompt, login flow forwarding, login flow redirect
  • All 103 existing tests pass
  • After merge + publish, bump version in elementor-ai and remove dead post-activation-redirect.ts

Made with Cursor

✨ PR Description

Purpose: Add referrer redirect functionality to OIDC authentication flow to enable post-authentication navigation with optional prompt parameters.

Main changes:

  • Implemented onAuthenticationComplete handler to check for referrer redirect data and navigate to stored URL with encoded prompt
  • Replaced openSidebarAfterAuthentication with unified completion handler that prioritizes redirect over sidebar toggle behavior
  • Added comprehensive test suite covering referrer redirect scenarios and OIDC authentication callback flows

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

Omerisra6 and others added 3 commits February 26, 2026 11:10
After OIDC authentication completes, check for a stored referrer redirect.
If present, navigate to the stored URL (with optional #angie-prompt= hash)
instead of opening the sidebar. This enables prompt-after-redirect flows
where a user is sent through auth and then redirected back with a prompt.

Made-with: Cursor
Comment on lines +56 to +59
forwardOidcLoginFlowToWindow( { targets, onSuccess: onAuthenticationComplete } );
} );

forwardOidcLoginFlowToWindow( { targets, onSuccess: openSidebarAfterAuthentication } );
forwardOidcLoginFlowToWindow( { targets, onSuccess: onAuthenticationComplete } );
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why the duplication ? @Omerisra6

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's not a new flow, I prefer to keep the same behavior

@Omerisra6 Omerisra6 merged commit 64e8060 into master Feb 26, 2026
15 checks passed
@Omerisra6 Omerisra6 deleted the feature/oauth-referrer-redirect branch February 26, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants