Repository navigation
🔑 Sign in with Google or Microsoft — and a server that stays up under a burst
Released 2026-10-29
This release adds sign-in with Google and Microsoft to the dashboard, moves the widget into a frame on our own origin with per-widget allowed domains, and fixes a backend that could stall under a burst of visitors. It also tightens which sites get sign-in credentials across origins, and makes knowledge sources stop running out of memory or getting stuck.
Single sign-on
Sign in with Google or Microsoft (#371)
Dashboard users can sign in with a Google or Microsoft account. The first sign-in links the account to the user with the same email, but only when the provider vouches for that address: a Gmail address or a Workspace domain for Google, and a verified domain (xms_edov), a tenant you pin, or a Microsoft mail domain for Microsoft. After that, the account is recognised by its provider ID, so a changed or recycled email can't take it over. Each user can link one account per provider; linked accounts are listed and unlinked through the API (no dashboard screen yet).
- Set
GOOGLE_SSO_CLIENT_ID/GOOGLE_SSO_CLIENT_SECRETand/orMICROSOFT_SSO_CLIENT_ID/MICROSOFT_SSO_CLIENT_SECRETto show the buttons. A provider without both is hidden. GOOGLE_SSO_HOSTED_DOMAINlimits Google to one Workspace domain;MICROSOFT_SSO_TENANTpins one Entra tenant (defaultcommon).PASSWORD_LOGIN_ENABLED=falsemakes the install SSO-first: users with a linked account can only sign in through it, and doing so ends their other sessions. Users without one keep their password, so nobody is locked out.- Changing your own email now asks for your current password and signs out your other sessions.
Setup for both providers is in the single sign-on docs.
Sign up through SSO (#383)
The SSO callback can hand a sign-in with no matching account to an optional enterprise hook instead of only refusing it. That's how ChatterMate Cloud lets people sign up with Google or Microsoft. Open-source installs still never create users from SSO. A deactivated user or inactive organization now gets its own message instead of "no account".
Widget
The widget runs on our origin (#377)
The loader now points the chat iframe at /widgets/{id}/frame instead of writing the chat into the page, so the widget runs on our origin, not the host site's.
- Each widget has allowed domains, enforced with CSP
frame-ancestors. Empty means anywhere, which is what existing widgets keep. Wildcards on a public suffix (*.co.uk) are refused. WIDGET_FRAME_URLserves the frame from a separate cookieless host if you have one.- An organization's website no longer has to be unique, since the widget doesn't depend on it (#381). It is stored as a normalised host and the dashboard accepts a pasted URL.
Sites with a strict Content-Security-Policy (#379)
When a site's CSP blocks our frame, the loader falls back to the previous in-page chat (served as /webclient/chattermate-legacy.min.js), still held to the widget's allowed domains. If that can't run either, the widget says the page's CSP blocks it, and the Widget tab shows the frame-src line to add.
Other widget fixes
- A tab left open past its token's expiry re-authorizes and reconnects, instead of retrying a dead token forever (#380).
- Widget API keys are looked up by hash instead of bcrypting every app's key on each request (#375).
Security
- Cross-origin credentials (#375). Every org's website is in the CORS list, and the API allowed credentials for all of them, so a page on any signed-up domain could read a signed-in dashboard user's responses. Now only
FRONTEND_URLand yourCORS_ORIGINSget credentials. The/agentsocket follows the same rule and refuses JSONP handshakes. - CORS refreshes (#368) update the middleware in place. Before, each refresh stacked another layer, and a removed origin kept access.
- Shopify (#376): signing in with
?shop_id=can no longer claim a store another org owns.
Reliability
- No more stalls under load (#382). Socket handlers and async routes took database connections on the event loop. When the pool filled, the server froze; 150 visitors loading a page at once froze it for about 5 minutes. Connections are now taken off the loop, and a burst queues instead.
- AI calls release their database connection (#378) while the model answers, so a few slow replies can't use up the pool.
- The dashboard refreshes the session once (#374) when several requests hit an expired token at once. Only a refused refresh signs you out, not a 502 during a deploy or a dropped connection.
Knowledge
- Pages, not downloads (#373). The crawler read installer downloads as pages and ran the worker out of memory. It now reads only pages (up to 5 MB each).
- Time and page limits (#373): website sources stop after
KB_SOURCE_TIME_LIMIT_SECONDS(30 min), and PDFs overKB_PDF_MAX_PAGES(300) are refused. A source left "processing" by a dead worker is failed and its owner told. - Sign-in pages are skipped (#376). Password, admin and closed-Shopify-store pages are never stored, and the source fails with advice to add the public site.
- Sources reach an agent (#385). A source added without an agent goes to the org's only agent, or the dialog asks which one. Agents with no knowledge say so. At the plan limit, the dialog offers to replace a source.
- Notifications can't fail a source (#372), and the processor now sets up Firebase so its pushes arrive.
KB_OPTIMIZE_ONis removed.
Onboarding
- The Test step's chat looks like the agent's widget and offers starter questions (#384).
- Connecting a Shopify store keeps your website instead of replacing it with the myshopify domain (#376).
Upgrading
Pull, rebuild and restart as usual. Five migrations run on start:
widget_key_lookup_001:widget_apps.api_key_lookup. Existing keys fill in the next time they're used.widget_allowed_domains_001:widgets.allowed_domains, NULL (anywhere) for existing widgets.org_domain_not_unique_001: drops the unique constraint onorganizations.domain.user_identities_001: the linked SSO accounts table, empty on deploy.auth_session_method_001:auth_sessions.auth_methodandidentity_id, with a partial index builtCONCURRENTLY.
New optional settings: the *_SSO_* keys and PASSWORD_LOGIN_ENABLED above, WIDGET_FRAME_URL, KB_SOURCE_TIME_LIMIT_SECONDS and KB_PDF_MAX_PAGES. A new Python dependency, tldextract, comes with the rebuild.
If your site's own CSP lists a frame-src, add your API origin (or WIDGET_FRAME_URL) to it so the framed widget loads.