Skip to content

Commit e8dfcf1

Browse files
authored
feat: enhanced typing for CurrentUserChecker by introducing generics (#1375)
1 parent 9c30c5e commit e8dfcf1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/CurrentUserChecker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ import { Action } from './Action';
33
/**
44
* Special function used to get currently authorized user.
55
*/
6-
export type CurrentUserChecker = (action: Action) => Promise<any> | any;
6+
export type CurrentUserChecker = <User = any>(action: Action) => Promise<User | null> | User | null;

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ export * from './CustomParameterDecorator';
8989
export * from './RoleChecker';
9090
export * from './Action';
9191
export * from './InterceptorInterface';
92+
export * from './CurrentUserChecker';
93+
export * from './AuthorizationChecker';
9294

9395
export * from './driver/BaseDriver';
9496
export * from './driver/express/ExpressDriver';

0 commit comments

Comments
 (0)