mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 18:55:19 -04:00
Add explicit Request type
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
a5d922b5f8
commit
fed3a12779
4 changed files with 22 additions and 18 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue