api Controller & token

This commit is contained in:
Julian Krauser 2025-01-21 13:54:52 +01:00
parent 36ecccd0dc
commit 4568bef10e
8 changed files with 115 additions and 5 deletions

View file

@ -29,6 +29,10 @@ export default async function authenticate(req: Request, res: Response, next: Fu
throw new InternalException("process failed");
}
if (decoded?.sub == "api_token_retrieve") {
throw new BadRequestException("This token is only authorized to get temporary access tokens via GET /api/webapi");
}
req.userId = decoded.userId;
req.username = decoded.username;
req.isOwner = decoded.isOwner;