refactor: prevent impersonation middelware

This commit is contained in:
Gabriellvl 2025-05-15 20:52:47 +02:00
parent a5e4f2437b
commit 26a01f0f30
5 changed files with 20 additions and 20 deletions

View file

@ -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);