mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-02-17 04:51:18 +00:00
adds MockAuthGuard which always return user 'hardcoded' Signed-off-by: Philip Molares <philip.molares@udo.edu>
18 lines
407 B
TypeScript
18 lines
407 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { ExecutionContext, Injectable } from '@nestjs/common';
|
|
|
|
@Injectable()
|
|
export class MockAuthGuard {
|
|
canActivate(context: ExecutionContext) {
|
|
const req = context.switchToHttp().getRequest();
|
|
req.user = {
|
|
userName: 'hardcoded',
|
|
};
|
|
return true;
|
|
}
|
|
}
|