Skip to content

Commit 386f5d4

Browse files
committed
test(plugin-auth): the tenant SMS template row is read in the resolved organization
The AuthManager test that pins "a tenant row overrides the built-in text" now composes a tenancy service answering the Default Organization and serves the row only to a read keyed by that organization, the way the phone SMS resolver reads since the template row is organization-scoped. Claude-Session: https://claude.ai/code/session_01UmqzD97e14iws6hmVhgZ5y Co-authored-by: Claude <noreply@anthropic.com>
1 parent aa935bf commit 386f5d4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎packages/plugins/plugin-auth/src/auth-manager.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2688,11 +2688,16 @@ describe('AuthManager', () => {
26882688
});
26892689

26902690
it('a tenant sys_notification_template row overrides the built-in text', async () => {
2691+
// The row is read in the organization the send resolves to,
2692+
// `tenancy.defaultOrgId()` — the Default Organization under `single`
2693+
// (phone-sms-texts.ts, "Which organization's row").
26912694
const { manager, opts } = await bootOtp({
2695+
getTenancy: () => ({ defaultOrgId: async () => 'org_default' }),
26922696
dataEngine: {
26932697
async find(object: string, q: any) {
26942698
if (
26952699
object === 'sys_notification_template' &&
2700+
q?.where?.organization_id === 'org_default' &&
26962701
q?.where?.topic === 'auth.phone_otp' &&
26972702
q?.where?.channel === 'sms' &&
26982703
q?.where?.locale === 'zh-CN'

0 commit comments

Comments
 (0)