Skip to content

Fix: Universal Login Authentication Profile reverts to Identifier+Password after import #1333

Merged
ankita10119 merged 2 commits intomasterfrom
DXCDT-1505
Mar 24, 2026
Merged

Fix: Universal Login Authentication Profile reverts to Identifier+Password after import #1333
ankita10119 merged 2 commits intomasterfrom
DXCDT-1505

Conversation

@ankita10119
Copy link
Copy Markdown
Contributor

🔧 Changes

Problem

When an import YAML includes a branding section alongside prompts.identifier_first: true, the Authentication Profile reverts from "Identifier First" back to "Identifier+Password" on newer Auth0 tenants after running a0deploy import. The issue does not occur when the branding section is absent from the YAML.


Root Cause

The PromptsHandler.processChanges had no @order decorator, causing it to default to execution order 50. The BrandingHandler.processChanges runs at order 70. This meant:

  1. Prompts (50) → PATCH /api/v2/prompts → sets identifier_first: true
  2. Branding (70) → PATCH /api/v2/branding → resets identifier_first on newer tenants as a backend side effect

Since branding ran after prompts, the branding update was silently undoing the identifier_first setting, but only on newer tenants where the backend behaves differently.


Fix

Added @order('80') to PromptsHandler.processChanges and imported the order decorator in prompts.ts. The execution order is now:

Handler Order
Branding 70
Prompts 80 ← moved
Tenant 100

This ensures prompts always runs after branding, so even if PATCH /api/v2/branding resets identifier_first on newer tenants, the prompts handler re-applies it correctly afterwards.

  • src/tools/auth0/handlers/prompts.ts: imported order decorator and added @order('80') to processChanges

📚 References

🔬 Testing

Reproduction confirmed using a minimal setup:

  • buggy.yaml - includes both branding and prompts.identifier_first: true
  • working.yaml - includes only prompts.identifier_first: true, no branding section

Before fix:
node ./lib/index.js import -c config.json -i ./local/buggy.yaml

Result: Authentication Profile reverted to "Identifier+Password"

After fix:
npm run build && node ./lib/index.js import -c config.json -i ./local/buggy.yaml

Result: Authentication Profile remained "Identifier First"

Both buggy.yaml and working.yaml now produce the correct result

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@ankita10119 ankita10119 requested a review from a team as a code owner March 24, 2026 04:47
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.16%. Comparing base (c57563b) to head (3459dd8).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1333   +/-   ##
=======================================
  Coverage   80.16%   80.16%           
=======================================
  Files         152      152           
  Lines        6095     6096    +1     
  Branches     1247     1247           
=======================================
+ Hits         4886     4887    +1     
  Misses        693      693           
  Partials      516      516           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@kushalshit27 kushalshit27 left a comment

Choose a reason for hiding this comment

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

LGTM

@ankita10119 ankita10119 merged commit a9098d6 into master Mar 24, 2026
8 checks passed
@ankita10119 ankita10119 deleted the DXCDT-1505 branch March 24, 2026 07:02
@ankita10119 ankita10119 mentioned this pull request Mar 25, 2026
@saltukalakus
Copy link
Copy Markdown

This fix should resolve #842

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.

4 participants