Skip to content

Commit 1783025

Browse files
authoredNov 13, 2024··
chore(shared,types): Replace veryStrict with strictMfa configuration for reverification (#4545)
1 parent 2c4d169 commit 1783025

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed
 

‎.changeset/poor-gorillas-complain.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@clerk/shared': minor
3+
'@clerk/types': minor
4+
---
5+
6+
Replace `veryStrict` with `strictMfa` configuration for reverification.

‎packages/clerk-js/src/core/resources/__tests__/Session.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ describe('Session', () => {
503503
} as SessionJSON);
504504

505505
const isAuthorized = session.checkAuthorization({
506-
__experimental_reverification: 'veryStrict',
506+
__experimental_reverification: 'strictMfa',
507507
});
508508

509509
expect(isAuthorized).toBe(true);

‎packages/react/src/hooks/__tests__/useAuth.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('useAuth type tests', () => {
6565

6666
it('veryStrict reverification is allowed', () => {
6767
expectTypeOf({
68-
__experimental_reverification: 'veryStrict',
68+
__experimental_reverification: 'strictMfa',
6969
} as const).toMatchTypeOf<ParamsOfHas>();
7070
});
7171

‎packages/shared/src/authorization.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type CheckStepUpAuthorization = (
3232
) => boolean | null;
3333

3434
const TYPES_TO_OBJECTS: TypesToConfig = {
35-
veryStrict: {
35+
strictMfa: {
3636
afterMinutes: 10,
3737
level: 'multiFactor',
3838
},
@@ -52,7 +52,7 @@ const TYPES_TO_OBJECTS: TypesToConfig = {
5252

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

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

5757
// Helper functions
5858
const isValidMaxAge = (maxAge: any) => typeof maxAge === 'number' && maxAge > 0;

‎packages/types/src/sessionVerification.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface __experimental_SessionVerificationResource extends ClerkResourc
1515

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

18-
export type __experimental_SessionVerificationTypes = 'veryStrict' | 'strict' | 'moderate' | 'lax';
18+
export type __experimental_SessionVerificationTypes = 'strictMfa' | 'strict' | 'moderate' | 'lax';
1919

2020
export type __experimental_ReverificationConfig =
2121
| __experimental_SessionVerificationTypes

0 commit comments

Comments
 (0)
Please sign in to comment.