Skip to content

Commit c06cd80

Browse files
committed
fix request user types
1 parent 0639d84 commit c06cd80

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

apps/api/libnest.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@ import * as url from 'node:url';
88

99
import { defineUserConfig } from '@douglasneuroinformatics/libnest/user-config';
1010
import { getReleaseInfo } from '@opendatacapture/release-info';
11+
import type { TokenPayload } from '@opendatacapture/schemas/auth';
1112

13+
import type { AppAbility } from '@/auth/auth.types.js';
1214
import type { RuntimePrismaClient } from '@/core/prisma.js';
1315
import type { $Env } from '@/core/schemas/env.schema.js';
1416

1517
declare module '@douglasneuroinformatics/libnest/user-config' {
1618
export namespace UserTypes {
1719
export interface Env extends $Env {}
1820
export interface PrismaClient extends RuntimePrismaClient {}
21+
export interface RequestUser extends TokenPayload {
22+
ability: AppAbility;
23+
}
1924
}
2025
}
2126

apps/api/src/typings/global.d.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1+
/* eslint-disable @typescript-eslint/no-empty-object-type */
12
/* eslint-disable @typescript-eslint/consistent-type-definitions */
23

3-
import type { TokenPayload } from '@opendatacapture/schemas/auth';
4+
import type { RequestUser } from '@douglasneuroinformatics/libnest';
45
import type { ReleaseInfo } from '@opendatacapture/schemas/setup';
56

6-
import type { AppAbility } from '@/auth/auth.types';
7-
87
declare global {
98
const __RELEASE__: ReleaseInfo;
109
namespace Express {
11-
interface User extends TokenPayload {
12-
ability: AppAbility;
13-
}
10+
interface User extends RequestUser {}
1411
}
1512
}

0 commit comments

Comments
 (0)