Skip to content

Commit 0f1e6fb

Browse files
committed
Add enterprise_sso for session reverification
1 parent 4a1d748 commit 0f1e6fb

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

packages/clerk-js/src/core/resources/Session.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type {
66
ActClaim,
77
CheckAuthorization,
88
EmailCodeConfig,
9+
EnterpriseSSOConfig,
910
GetToken,
1011
GetTokenOptions,
1112
PhoneCodeConfig,
@@ -179,6 +180,12 @@ export class Session extends BaseResource implements SessionResource {
179180
case 'passkey':
180181
config = {};
181182
break;
183+
case 'enterprise_sso':
184+
config = {
185+
emailAddressId: factor.emailAddressId,
186+
enterpriseConnectionId: factor.enterpriseConnectionId,
187+
} as EnterpriseSSOConfig;
188+
break;
182189
default:
183190
clerkInvalidStrategy('Session.prepareFirstFactorVerification', (factor as any).strategy);
184191
}

packages/types/src/factors.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ export type EnterpriseSSOConfig = EnterpriseSSOFactor & {
116116
redirectUrl: string;
117117
actionCompleteRedirectUrl: string;
118118
oidcPrompt?: string;
119+
/**
120+
* @experimental
121+
*/
122+
emailAddressId?: string;
123+
/**
124+
* @experimental
125+
*/
126+
enterpriseConnectionId?: string;
119127
};
120128

121129
export type PhoneCodeSecondFactorConfig = {

packages/types/src/session.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {
22
BackupCodeAttempt,
33
EmailCodeAttempt,
44
EmailCodeConfig,
5+
EnterpriseSSOConfig,
56
PasskeyAttempt,
67
PassKeyConfig,
78
PasswordAttempt,
@@ -351,7 +352,11 @@ export type SessionVerifyCreateParams = {
351352
level: SessionVerificationLevel;
352353
};
353354

354-
export type SessionVerifyPrepareFirstFactorParams = EmailCodeConfig | PhoneCodeConfig | PassKeyConfig;
355+
export type SessionVerifyPrepareFirstFactorParams =
356+
| EmailCodeConfig
357+
| PhoneCodeConfig
358+
| PassKeyConfig
359+
| EnterpriseSSOConfig;
355360
export type SessionVerifyAttemptFirstFactorParams =
356361
| EmailCodeAttempt
357362
| PhoneCodeAttempt

0 commit comments

Comments
 (0)