KamoCRM

Persist selected OAuth provider on callback so it stops reverting to KamoMail

FixEmailService
Shipped
8 ஜூலை, 2026 அன்று 9:51 PM UTC
Author
Kamo
Commit
e97fc05

Switching an org to Microsoft 365 (or Google Workspace / Zoho) never stuck: the OAuth callback stored tokens and only flipped status on a pre-existing provider row, never writing provider_type and no-op'ing entirely when the org had no row. The read path then fell back to the hard-coded KAMO_MAIL default, so the settings page reverted. Upsert the org_email_providers row with the provider carried in the OAuth state and mark it ACTIVE. Adds OAuthFlowServiceTest covering the no-row and KamoMail-row cases.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing