|
1 | 1 | import type {
|
2 |
| - ActClaim, |
3 | 2 | JwtPayload,
|
4 | 3 | OrganizationCustomPermissionKey,
|
5 | 4 | OrganizationCustomRoleKey,
|
6 |
| - SessionStatusClaim, |
| 5 | + SharedSignedInAuthObjectProperties, |
7 | 6 | } from '@clerk/types';
|
8 | 7 |
|
9 |
| -/** |
10 |
| - * @internal |
11 |
| - */ |
12 |
| -type SignedInAuthObjectProperties = { |
13 |
| - sessionClaims: JwtPayload; |
14 |
| - sessionId: string; |
15 |
| - sessionStatus: SessionStatusClaim | null; |
16 |
| - actor: ActClaim | undefined; |
17 |
| - userId: string; |
18 |
| - orgId: string | undefined; |
19 |
| - orgRole: OrganizationCustomRoleKey | undefined; |
20 |
| - orgSlug: string | undefined; |
21 |
| - orgPermissions: OrganizationCustomPermissionKey[] | undefined; |
22 |
| - /** |
23 |
| - * Factor Verification Age |
24 |
| - * Each item represents the minutes that have passed since the last time a first or second factor were verified. |
25 |
| - * [fistFactorAge, secondFactorAge] |
26 |
| - */ |
27 |
| - factorVerificationAge: [firstFactorAge: number, secondFactorAge: number] | null; |
28 |
| -}; |
29 |
| - |
30 | 8 | const parseFeatures = (fea: string | undefined) => {
|
31 | 9 | const features = fea ? fea.split(',').map(f => f.trim()) : [];
|
32 | 10 |
|
@@ -100,7 +78,7 @@ function buildOrgPermissions({
|
100 | 78 | *
|
101 | 79 | * Resolves the signed-in auth state from JWT claims.
|
102 | 80 | */
|
103 |
| -const __experimental_JWTPayloadToAuthObjectProperties = (claims: JwtPayload): SignedInAuthObjectProperties => { |
| 81 | +const __experimental_JWTPayloadToAuthObjectProperties = (claims: JwtPayload): SharedSignedInAuthObjectProperties => { |
104 | 82 | let orgId: string | undefined;
|
105 | 83 | let orgRole: OrganizationCustomRoleKey | undefined;
|
106 | 84 | let orgSlug: string | undefined;
|
|
0 commit comments