Add authorization

This commit is contained in:
2024-12-20 13:17:53 +05:30
parent 4b49c43a0c
commit a584fc91b5
16 changed files with 112 additions and 58 deletions

View File

@@ -12,6 +12,8 @@ export default function organizationRoutes(fastify: FastifyInstance) {
201: $org("createOrgResponse"),
},
},
config: { requiredClaims: ["org:write"] },
preHandler: [fastify.authorize],
},
createOrgHandler
);
@@ -27,6 +29,7 @@ export default function organizationRoutes(fastify: FastifyInstance) {
},
},
},
config: { requiredClaims: ["org:read"] },
},
getOrgHandler
);