Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/api/routes/iam.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FastifyPluginAsync } from "fastify";
import { allAppRoles, AppRoles } from "../../common/roles.js";

Check warning on line 2 in src/api/routes/iam.ts

View workflow job for this annotation

GitHub Actions / Run Unit Tests

'allAppRoles' is defined but never used. Allowed unused vars must match /^_/u
import { zodToJsonSchema } from "zod-to-json-schema";
import {
addToTenant,
Expand All @@ -16,7 +16,7 @@
EntraInvitationError,
InternalServerError,
NotFoundError,
UnauthorizedError,

Check warning on line 19 in src/api/routes/iam.ts

View workflow job for this annotation

GitHub Actions / Run Unit Tests

'UnauthorizedError' is defined but never used. Allowed unused vars must match /^_/u
} from "../../common/errors/index.js";
import { DynamoDBClient, PutItemCommand } from "@aws-sdk/client-dynamodb";
import { genericConfig, roleArns } from "../../common/config.js";
Expand Down Expand Up @@ -79,13 +79,13 @@
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"];
Expand All @@ -99,7 +99,7 @@
userOid,
request.body,
);
reply.send(201);
reply.status(201);
},
);
fastify.get<{
Expand Down
Loading