Skip to content

Commit 7706e00

Browse files
authored
fix IAM profile patch route (#93)
1 parent 208f447 commit 7706e00

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/api/routes/iam.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ const iamRoutes: FastifyPluginAsync = async (fastify, _options) => {
7979
await fastify.zodValidateBody(request, reply, entraProfilePatchRequest);
8080
},
8181
onRequest: async (request, reply) => {
82-
await fastify.authorize(request, reply, allAppRoles);
82+
await fastify.authorize(request, reply, []);
8383
},
8484
},
8585
async (request, reply) => {
8686
if (!request.tokenPayload || !request.username) {
87-
throw new UnauthorizedError({
88-
message: "User does not have the privileges for this task.",
87+
throw new InternalServerError({
88+
message: "Could not find token payload and/or username.",
8989
});
9090
}
9191
const userOid = request.tokenPayload["oid"];
@@ -99,7 +99,7 @@ const iamRoutes: FastifyPluginAsync = async (fastify, _options) => {
9999
userOid,
100100
request.body,
101101
);
102-
reply.send(201);
102+
reply.status(201);
103103
},
104104
);
105105
fastify.get<{

0 commit comments

Comments
 (0)