fix: admin_create_organization writes full auth flags - #5819
fix: admin_create_organization writes full auth flags#5819Christian-Sidak wants to merge 1 commit into
Conversation
The admin mint endpoint wrote only {is_demo: False} as the org flags,
omitting allow_email/allow_social and all other keys. The frontend's
filterOrgsByAuthMethod requires allow_email to offer the email login
path, so admin-minted accounts could not log in via the web UI
(no_compatible_orgs). Mirror the same flags dict that create_organization
uses, reading allow_email/allow_social from env.auth just like the
normal signup path.
Fixes Agenta-AI#5791
Signed-off-by: Christian Sidak <christian@sentineltech.eu>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Christian-Sidak <61099993+Christian-Sidak@users.noreply.github.com>
|
@Christian-Sidak is attempting to deploy a commit to the agenta projects Team on Vercel. A member of the Team first needs to authorize it. |
|
|
|
✅ Thanks @Christian-Sidak! This PR now meets the contribution requirements and has been reopened. A maintainer will review it soon. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Disabled knowledge base sources:
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesAdmin organization flags
Estimated code review effort: 2 (Simple) | ~10 minutes ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
admin_create_organization()inapi/oss/src/services/db_manager.pywroteflags={"is_demo": False}-- omittingallow_email,allow_social, and all other flag keys.filterOrgsByAuthMethodrequiresallow_emailto be present and truthy before it will offer the email login path. An org with onlyis_demoset matches zero auth methods, leaving the user withno_compatible_orgs.flagsdict thatcreate_organization()writes (includingallow_email: env.auth.email_enabled,allow_social: env.auth.oidc_enabled, and the remaining boolean flags).Fixes #5791
Demo
Before the fix,
admin_create_organizationproduced:After the fix, it produces the full set of auth flags (matching
create_organization):The two new unit tests confirm this:
Test plan
test_admin_create_organization_includes_allow_email_flag-- assertsallow_emailis present andTruewhen email auth is enabled.test_admin_create_organization_flags_mirror_create_organization-- asserts the flags dict contains exactly the same keys as the normal signup path (create_organization).ruff formatandruff checkpass on all touched files.