Skip to content

Commit b460b13

Browse files
committed
wip: adapter read pin carries the injected member; schema note
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nXM5CEyYnbaY58Spo
1 parent 97b9ddd commit b460b13

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎packages/plugins/plugin-auth/src/auth-schema-config.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,13 @@ export const buildOidcProviderPluginSchema = buildOauthProviderPluginSchema;
946946
// unless it is actually handed to `sso({ schema })` — the one trigger #10074
947947
// named that would justify that rewiring is sso needing `additionalFields`,
948948
// which has no adapter-layer equivalent.
949+
//
950+
// That trigger has now fired, for `additionalFields` ONLY: the per-provider
951+
// sign-in toggles `allowIdpInitiated` / `allowJit` (`sso-sign-in-options.ts`)
952+
// are handed to `sso({ schema: { ssoProvider: { additionalFields } } })`. No
953+
// `modelName` and no `fields` map go with them, so the adapter rule above still
954+
// owns every column name (`allow_idp_initiated`, `allow_jit`), declared on the
955+
// `sys_sso_provider` platform object.
949956

950957
// ---------------------------------------------------------------------------
951958
// SCIM plugin – scim* tables (@better-auth/scim)

‎packages/plugins/plugin-auth/src/objectql-adapter.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,10 @@ describe('createObjectQLAdapterFactory – adapter-layer plugin bridging (@bette
348348
model: 'ssoProvider',
349349
where: [{ field: 'providerId', value: 'okta', operator: 'eq', connector: 'AND' }],
350350
});
351-
expect(row).toMatchObject({ providerId: 'okta', oidcConfig: '{"clientId":"x"}' });
351+
// The blob also carries `allowIdpInitiated`, written from the provider's
352+
// `allow_idp_initiated` column on every read (`sso-sign-in-options.ts`);
353+
// this row has none, so it reads off.
354+
expect(row).toMatchObject({ providerId: 'okta', oidcConfig: '{"clientId":"x","allowIdpInitiated":false}' });
352355
expect(row).not.toHaveProperty('oidc_config');
353356
});
354357
});

0 commit comments

Comments
 (0)