Skip to content

Commit

Permalink
fix: replace generic with any
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Sep 11, 2023
1 parent 7690d72 commit eabad6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/ban-types': 'off'
},
};
14 changes: 8 additions & 6 deletions lib/auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ export type IAuthGuard = CanActivate & {
request: TRequest
): Promise<void>;
handleRequest<TUser = any>(
err,
user,
info,
err: any,
user: any,
info: any,
context: ExecutionContext,
status?
status?: any
): TUser;
getAuthenticateOptions(
context: ExecutionContext
): IAuthModuleOptions | undefined;
getRequest<T = any>(context: ExecutionContext): T;
getRequest(context: ExecutionContext): any;
};

export const AuthGuard: (type?: string | string[]) => Type<IAuthGuard> =
Expand Down Expand Up @@ -87,7 +87,9 @@ function createAuthGuard(type?: string | string[]): Type<IAuthGuard> {
): Promise<void> {
const user = request[this.options.property || defaultOptions.property];
await new Promise<void>((resolve, reject) =>
request.logIn(user, this.options, (err) => (err ? reject(err) : resolve()))
request.logIn(user, this.options, (err) =>
err ? reject(err) : resolve()
)
);
}

Expand Down

0 comments on commit eabad6a

Please sign in to comment.