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
6 changes: 6 additions & 0 deletions .changeset/poor-gorillas-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@clerk/shared': minor
'@clerk/types': minor
---

Replace `veryStrict` with `strictMfa` configuration for reverification.
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ describe('Session', () => {
} as SessionJSON);

const isAuthorized = session.checkAuthorization({
__experimental_reverification: 'veryStrict',
__experimental_reverification: 'strictMfa',
});

expect(isAuthorized).toBe(true);
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/hooks/__tests__/useAuth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('useAuth type tests', () => {

it('veryStrict reverification is allowed', () => {
expectTypeOf({
__experimental_reverification: 'veryStrict',
__experimental_reverification: 'strictMfa',
} as const).toMatchTypeOf<ParamsOfHas>();
});

Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type CheckStepUpAuthorization = (
) => boolean | null;

const TYPES_TO_OBJECTS: TypesToConfig = {
veryStrict: {
strictMfa: {
afterMinutes: 10,
level: 'multiFactor',
},
Expand All @@ -52,7 +52,7 @@ const TYPES_TO_OBJECTS: TypesToConfig = {

const ALLOWED_LEVELS = new Set<__experimental_SessionVerificationLevel>(['firstFactor', 'secondFactor', 'multiFactor']);

const ALLOWED_TYPES = new Set<__experimental_SessionVerificationTypes>(['veryStrict', 'strict', 'moderate', 'lax']);
const ALLOWED_TYPES = new Set<__experimental_SessionVerificationTypes>(['strictMfa', 'strict', 'moderate', 'lax']);

// Helper functions
const isValidMaxAge = (maxAge: any) => typeof maxAge === 'number' && maxAge > 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/sessionVerification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface __experimental_SessionVerificationResource extends ClerkResourc

export type __experimental_SessionVerificationStatus = 'needs_first_factor' | 'needs_second_factor' | 'complete';

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

export type __experimental_ReverificationConfig =
| __experimental_SessionVerificationTypes
Expand Down
Loading