Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/fluffy-goats-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@clerk/clerk-js": minor
"@clerk/types": minor
---

Drop `maxAgeMinutes` from `__experimental_startVerification`.
Drop types `__experimental_SessionVerificationConfig` and `__experimental_SessionVerificationMaxAgeMinutes`.
2 changes: 0 additions & 2 deletions packages/clerk-js/src/core/resources/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,13 @@ export class Session extends BaseResource implements SessionResource {

__experimental_startVerification = async ({
level,
maxAgeMinutes,
}: __experimental_SessionVerifyCreateParams): Promise<__experimental_SessionVerificationResource> => {
const json = (
await BaseResource._fetch({
method: 'POST',
path: `/client/sessions/${this.id}/verify`,
body: {
level,
maxAgeMinutes,
} as any,
})
)?.response as unknown as __experimental_SessionVerificationJSON;
Expand Down
2 changes: 0 additions & 2 deletions packages/types/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import type { ClerkResource } from './resource';
import type {
__experimental_ReverificationConfig,
__experimental_SessionVerificationLevel,
__experimental_SessionVerificationMaxAgeMinutes,
__experimental_SessionVerificationResource,
} from './sessionVerification';
import type { TokenResource } from './token';
Expand Down Expand Up @@ -155,7 +154,6 @@ export type GetToken = (options?: GetTokenOptions) => Promise<string | null>;

export type __experimental_SessionVerifyCreateParams = {
level: __experimental_SessionVerificationLevel;
maxAgeMinutes: __experimental_SessionVerificationMaxAgeMinutes;
};

export type __experimental_SessionVerifyPrepareFirstFactorParams = EmailCodeConfig | PhoneCodeConfig;
Expand Down
11 changes: 2 additions & 9 deletions packages/types/src/sessionVerification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,15 @@ export type __experimental_SessionVerificationStatus = 'needs_first_factor' | 'n

export type __experimental_SessionVerificationTypes = 'veryStrict' | 'strict' | 'moderate' | 'lax';

export type __experimental_SessionVerificationConfig =
| __experimental_SessionVerificationTypes
| {
level: __experimental_SessionVerificationLevel;
maxAgeMinutes: __experimental_SessionVerificationMaxAgeMinutes;
};

export type __experimental_ReverificationConfig =
| __experimental_SessionVerificationTypes
| {
level: __experimental_SessionVerificationLevel;
afterMinutes: __experimental_SessionVerificationMaxAgeMinutes;
afterMinutes: __experimental_SessionVerificationAfterMinutes;
};

export type __experimental_SessionVerificationLevel = 'firstFactor' | 'secondFactor' | 'multiFactor';
export type __experimental_SessionVerificationMaxAgeMinutes = number;
export type __experimental_SessionVerificationAfterMinutes = number;

export type __experimental_SessionVerificationFirstFactor = EmailCodeFactor | PhoneCodeFactor | PasswordFactor;
export type __experimental_SessionVerificationSecondFactor = PhoneCodeFactor | TOTPFactor | BackupCodeFactor;
Loading