Skip to content

fix: Fix redirection logic to always route users to the authn MFE#117

Closed
subhashree-sahu31 wants to merge 7 commits intorelease-ulmofrom
AUT-31-code-change-identification-for-enterprise-applications
Closed

fix: Fix redirection logic to always route users to the authn MFE#117
subhashree-sahu31 wants to merge 7 commits intorelease-ulmofrom
AUT-31-code-change-identification-for-enterprise-applications

Conversation

@subhashree-sahu31
Copy link

  • Removed conditional checks for enterprise customers, third-party auth hints, and SAML providers.
  • Simplified the redirection logic to ensure all users are redirected to the authentication microfrontend (authn MFE) when the toggle is enabled.
  • Addressed issues causing incorrect redirection behavior in certain scenarios.

- Removed conditional checks for enterprise customers, third-party auth hints, and SAML providers.
- Simplified the redirection logic to ensure all users are redirected to the authentication microfrontend (authn MFE) when the toggle is enabled.
- Addressed issues causing incorrect redirection behavior in certain scenarios.
Copy link

@ssurendrannair ssurendrannair left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR simplifies the redirection logic for the authentication microfrontend (authn MFE) by removing conditional checks that were preventing certain users from being redirected when the authn MFE toggle is enabled. The change ensures that all users are consistently routed through the authn MFE when the feature is activated.

Changes:

  • Removed conditional checks for enterprise customers, third-party auth hints, and SAML providers from the authn MFE redirection logic
  • Simplified the redirection condition to only check if the authn MFE feature toggle is enabled

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 11, 2026 13:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 11, 2026 14:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +205 to 206
if should_redirect_to_authn_microfrontend():
# This is to handle a case where a logged-in cookie is not present but the user is authenticated.
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

This change alters redirect behavior for enterprise customers, tpa_hint flows, and SAML-running pipelines when ENABLE_AUTHN_MICROFRONTEND is enabled. There are existing logistration redirect tests, but none that assert the new behavior for these scenarios; please add/update tests to cover (at least) enterprise_customer present, next containing tpa_hint, and an active SAML pipeline so future changes don’t reintroduce the previous conditional behavior.

Copilot uses AI. Check for mistakes.
Comment on lines 203 to 206
enterprise_customer = enterprise_customer_for_request(request)

if should_redirect_to_authn_microfrontend() and \
not enterprise_customer and \
not tpa_hint_provider and \
not saml_provider:

if should_redirect_to_authn_microfrontend():
# This is to handle a case where a logged-in cookie is not present but the user is authenticated.
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

With the redirect condition simplified to should_redirect_to_authn_microfrontend() only, the earlier saml_provider/running_pipeline check is now dead code and the comment block describing enterprise/TPA/SAML conditions is out of date. Consider removing the unused SAML detection block and moving the enterprise_customer_for_request() call below the redirect branch so we don’t do extra work (and potential DB calls) on requests that immediately redirect to the authn MFE.

Copilot uses AI. Check for mistakes.
@subhashree-sahu31
Copy link
Author

The PR is failing due to missing pkg_resources, which is part of setuptools. I will update the workflow to ensure setuptools is installed before running the dependency check and re-test.

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.

3 participants

Comments