File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @clerk/clerk-sdk-node ' : major
3+ ---
4+
5+ Changes the ` request.auth ` type from ` LegacyAuthObject ` to ` AuthObject ` .
6+ ``` typescript
7+ type LegacyAuthObject = {
8+ sessionId: string | null ;
9+ actor: ActClaim | undefined | null ;
10+ userId: string | null ;
11+ getToken: ServerGetToken | null ;
12+ debug: AuthObjectDebug | null ;
13+ claims: JwtPayload | null ;
14+ }
15+
16+ type AuthObject = {
17+ sessionClaims: JwtPayload | null ;
18+ sessionId: string | null ;
19+ actor: ActClaim | undefined | null ;
20+ userId: string | null ;
21+ orgId: string | undefined | null ;
22+ orgRole: OrganizationCustomRoleKey | undefined | null ;
23+ orgSlug: string | undefined | null ;
24+ orgPermissions: OrganizationCustomPermissionKey [] | undefined | null ;
25+ getToken: ServerGetToken | null ;
26+ has: CheckAuthorizationWithCustomPermissions | null ;
27+ debug: AuthObjectDebug | null ;
28+ };
29+ ```
Original file line number Diff line number Diff line change @@ -4,10 +4,6 @@ import type { MultiDomainAndOrProxy } from '@clerk/types';
44import type { NextFunction , Request , Response } from 'express' ;
55import type { IncomingMessage } from 'http' ;
66
7- type LegacyAuthObject < T extends AuthObject > = Pick < T , 'sessionId' | 'userId' | 'actor' | 'getToken' | 'debug' > & {
8- claims : AuthObject [ 'sessionClaims' ] ;
9- } ;
10-
117export type MiddlewareWithAuthProp = (
128 // req: WithAuthProp<Request>
139 req : Request ,
@@ -22,8 +18,8 @@ export type MiddlewareRequireAuthProp = (
2218 next : NextFunction ,
2319) => Promise < void > ;
2420
25- export type LooseAuthProp = { auth : LegacyAuthObject < AuthObject > } ;
26- export type StrictAuthProp = { auth : LegacyAuthObject < SignedInAuthObject > } ;
21+ export type LooseAuthProp = { auth : AuthObject } ;
22+ export type StrictAuthProp = { auth : SignedInAuthObject } ;
2723export type WithAuthProp < T > = T & LooseAuthProp ;
2824export type RequireAuthProp < T > = T & StrictAuthProp ;
2925
You can’t perform that action at this time.
0 commit comments