Skip to content

Commit

Permalink
Add authorities endpoint and modify cache clear route method
Browse files Browse the repository at this point in the history
  • Loading branch information
Wassim-Rached committed Nov 1, 2024
1 parent 5af7472 commit d7cec5d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/routers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ export function handleRoutes(app: Express) {
return res.status(statusCode).json(result);
});

app.get("/api/authorities", (req: Request, res: Response) => {
const authorities: string[] = Object.values(AUTHORITIES);
res.json(authorities);
});

// Login route
app.post("/api/token", async (req: Request, res: Response) => {
const { email, password } = req.body;
Expand Down Expand Up @@ -142,6 +147,7 @@ export function handleRoutes(app: Express) {
}
);

// cache routes
app.get(
"/api/token/authorities/cache",
extractJwt,
Expand Down Expand Up @@ -180,7 +186,7 @@ export function handleRoutes(app: Express) {
}
);

app.post(
app.delete(
"/api/token/authorities/cache/clear-all",
extractJwt,
requireJwt,
Expand Down

0 comments on commit d7cec5d

Please sign in to comment.