mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 19:26:31 -05:00
Add custom express types
We add a custom User object into the request object. To be able to use that object in a strongly-typed situation, we need to tell TypeScript that it exists. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
ba771fb7b6
commit
f3f0360a95
1 changed files with 13 additions and 0 deletions
13
types/express/index.d.ts
vendored
Normal file
13
types/express/index.d.ts
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { User} from '../../src/users/user.entity';
|
||||
|
||||
declare module 'express' {
|
||||
export interface Request {
|
||||
user?: User;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue