From 5b1ce9e41136e4d4d420314024c0ca5dce451b7c Mon Sep 17 00:00:00 2001 From: Dev Singh Date: Thu, 27 Mar 2025 16:14:04 -0500 Subject: [PATCH] fix IAM profile patch route --- src/api/routes/iam.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/routes/iam.ts b/src/api/routes/iam.ts index 947479db..b390bd1c 100644 --- a/src/api/routes/iam.ts +++ b/src/api/routes/iam.ts @@ -79,13 +79,13 @@ const iamRoutes: FastifyPluginAsync = async (fastify, _options) => { await fastify.zodValidateBody(request, reply, entraProfilePatchRequest); }, onRequest: async (request, reply) => { - await fastify.authorize(request, reply, allAppRoles); + await fastify.authorize(request, reply, []); }, }, async (request, reply) => { if (!request.tokenPayload || !request.username) { - throw new UnauthorizedError({ - message: "User does not have the privileges for this task.", + throw new InternalServerError({ + message: "Could not find token payload and/or username.", }); } const userOid = request.tokenPayload["oid"]; @@ -99,7 +99,7 @@ const iamRoutes: FastifyPluginAsync = async (fastify, _options) => { userOid, request.body, ); - reply.send(201); + reply.status(201); }, ); fastify.get<{