Skip to content

Fix: Bad request error when no email provider is configured#1321

Open
ankita10119 wants to merge 2 commits intomasterfrom
DXCDT-1472
Open

Fix: Bad request error when no email provider is configured#1321
ankita10119 wants to merge 2 commits intomasterfrom
DXCDT-1472

Conversation

@ankita10119
Copy link

@ankita10119 ankita10119 commented Mar 9, 2026

🔧 Changes

Added a guard in emailProvider.ts to short-circuit the delete/update logic when no existing provider is present (!existing.name). If there's nothing to delete, we return early and skip the API call entirely.

🔬 Testing

Added a test case covering the scenario where emailProvider is empty, AUTH0_ALLOW_DELETE is true, and no existing provider exists - asserting that neither update nor create are called.

📝 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 9, 2026 16:51
@codecov-commenter
Copy link

codecov-commenter commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.16%. Comparing base (7e07417) to head (ae82f87).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1321   +/-   ##
=======================================
  Coverage   80.15%   80.16%           
=======================================
  Files         152      152           
  Lines        6088     6089    +1     
  Branches     1243     1244    +1     
=======================================
+ Hits         4880     4881    +1     
  Misses        693      693           
  Partials      515      515           

☔ 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.

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