mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 09:46:30 -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
68fd375d95
commit
cc010ddf2a
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