inital #3
This commit is contained in:
32
README.md
32
README.md
@@ -10,6 +10,36 @@ npm install git+https://git.biotronik.int/scm/coe-bs-website/node-pkg-express-ut
|
||||
|
||||
##### 2. Copy the types
|
||||
|
||||
Copy the folder `src/types` to some location within the source folder of your project.
|
||||
Copy the content below to any location within the source folder of your project and name it `extend-request.d.ts`.
|
||||
It just needs to sit there with no more action required.
|
||||
|
||||
```ts
|
||||
// extend-request.d.ts
|
||||
|
||||
declare global {
|
||||
namespace Express {
|
||||
interface UserInfo {
|
||||
email: string,
|
||||
email_verified: boolean,
|
||||
family_name: string,
|
||||
given_name: string,
|
||||
groups: string[],
|
||||
name: string,
|
||||
preferred_username: string,
|
||||
sub: string,
|
||||
}
|
||||
|
||||
interface Request {
|
||||
getUserInfo(): Promise<UserInfo|undefined>;
|
||||
noLogging: boolean|undefined;
|
||||
permissionDetails?: import('role-acl').Permission;
|
||||
}
|
||||
|
||||
interface Response {
|
||||
initLogout(): boolean;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user