refactor: prevent impersonation middelware
This commit is contained in:
parent
a5e4f2437b
commit
26a01f0f30
5 changed files with 20 additions and 20 deletions
|
@ -5,4 +5,4 @@ import { AuthenticatedRequest } from '../authenticated-request.js';
|
|||
/**
|
||||
* Only allow the user whose username is in the path parameter "username" to access the endpoint.
|
||||
*/
|
||||
export const onlyAllowUserHimself = authorize((auth: AuthenticationInfo, req: AuthenticatedRequest) => req.params.username === auth.username);
|
||||
export const preventImpersonation = authorize((auth: AuthenticationInfo, req: AuthenticatedRequest) => req.params.username === auth.username);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue