mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-15 20:25:23 +02:00
fix: update API key deletion authorization check
- Changed the authorization check for deleting an API key to use referenceId instead of userId, ensuring proper validation against the current user's ID.
This commit is contained in:
@@ -465,7 +465,7 @@ export const userRouter = createTRPCRouter({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (apiKeyToDelete.userId !== ctx.user.id) {
|
if (apiKeyToDelete.referenceId !== ctx.user.id) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: "UNAUTHORIZED",
|
code: "UNAUTHORIZED",
|
||||||
message: "You are not authorized to delete this API key",
|
message: "You are not authorized to delete this API key",
|
||||||
|
|||||||
Reference in New Issue
Block a user