Add explicit Request type

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-02-23 21:48:37 +01:00
parent a5d922b5f8
commit fed3a12779
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
4 changed files with 22 additions and 18 deletions

View file

@ -7,6 +7,7 @@
import { ExecutionContext, Injectable } from '@nestjs/common';
import { UsersService } from '../users/users.service';
import { User } from '../users/user.entity';
import { Request } from 'express';
@Injectable()
export class MockAuthGuard {
@ -14,7 +15,7 @@ export class MockAuthGuard {
constructor(private usersService: UsersService) {}
async canActivate(context: ExecutionContext) {
const req = context.switchToHttp().getRequest();
const req: Request = context.switchToHttp().getRequest();
if (!this.user) {
// this assures that we can create the user 'hardcoded', if we need them before any calls are made or
// create them on the fly when the first call to the api is made