feat(backend): Generic authentication checks.
Added support for deciding based on any predicate about the current AuthenticationInfo whether or not a request will be accepted.
This commit is contained in:
parent
054e761baa
commit
69ba8c9567
2 changed files with 29 additions and 16 deletions
|
@ -1,6 +1,9 @@
|
|||
import { Request } from "express";
|
||||
import { JwtPayload } from "jsonwebtoken";
|
||||
import {AuthenticationInfo} from "./authentication-info";
|
||||
|
||||
export interface AuthenticatedRequest extends Request {
|
||||
auth?: JwtPayload; // Optional, as req.auth might be undefined if authentication is optional
|
||||
// Properties are optional since the user is not necessarily authenticated.
|
||||
jwtPayload?: JwtPayload;
|
||||
auth?: AuthenticationInfo;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue