packages/upgrade/src/versions/core-2/node/legacyauthobject-removed.md
We changed the values that our middleware adds to the request object after running. Previously it returned a LegacyAuthObject type, and now it returns an AuthObject type, the difference between the two types is as such:
- type LegacyAuthObject = {
+ type AuthObject = {
sessionId: string | null;
actor: ActClaim | undefined | null;
userId: string | null;
getToken: ServerGetToken | null;
debug: AuthObjectDebug | null;
- claims: JwtPayload | null;
+ sessionClaims: JwtPayload | null;
+ orgId: string | undefined | null;
+ orgRole: OrganizationCustomRoleKey | undefined | null;
+ orgSlug: string | undefined | null;
+ orgPermissions: OrganizationCustomPermissionKey[] | undefined | null;
+ has: CheckAuthorizationWithCustomPermissions | null;
}
If you were using the claims key on the request after running middleware, you will need to instead use sessionClaims. Additionally, if you were using the LooseAuthProp or StrictAuthProp exported types anywhere, note that these have been adjusted to fit the shape of the new middleware response typing.