diff --git a/.eslintrc.js b/.eslintrc.js index c34fdb3c..8ccf1c23 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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' }, }; diff --git a/lib/auth.guard.ts b/lib/auth.guard.ts index 599b9e1a..d2203adb 100644 --- a/lib/auth.guard.ts +++ b/lib/auth.guard.ts @@ -22,16 +22,16 @@ export type IAuthGuard = CanActivate & { request: TRequest ): Promise; handleRequest( - err, - user, - info, + err: any, + user: any, + info: any, context: ExecutionContext, - status? + status?: any ): TUser; getAuthenticateOptions( context: ExecutionContext ): IAuthModuleOptions | undefined; - getRequest(context: ExecutionContext): T; + getRequest(context: ExecutionContext): any; }; export const AuthGuard: (type?: string | string[]) => Type = @@ -87,7 +87,9 @@ function createAuthGuard(type?: string | string[]): Type { ): Promise { const user = request[this.options.property || defaultOptions.property]; await new Promise((resolve, reject) => - request.logIn(user, this.options, (err) => (err ? reject(err) : resolve())) + request.logIn(user, this.options, (err) => + err ? reject(err) : resolve() + ) ); }