Skip to content

Commit d7cec5d

Browse files
committed
Add authorities endpoint and modify cache clear route method
1 parent 5af7472 commit d7cec5d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/routers.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ export function handleRoutes(app: Express) {
7070
return res.status(statusCode).json(result);
7171
});
7272

73+
app.get("/api/authorities", (req: Request, res: Response) => {
74+
const authorities: string[] = Object.values(AUTHORITIES);
75+
res.json(authorities);
76+
});
77+
7378
// Login route
7479
app.post("/api/token", async (req: Request, res: Response) => {
7580
const { email, password } = req.body;
@@ -142,6 +147,7 @@ export function handleRoutes(app: Express) {
142147
}
143148
);
144149

150+
// cache routes
145151
app.get(
146152
"/api/token/authorities/cache",
147153
extractJwt,
@@ -180,7 +186,7 @@ export function handleRoutes(app: Express) {
180186
}
181187
);
182188

183-
app.post(
189+
app.delete(
184190
"/api/token/authorities/cache/clear-all",
185191
extractJwt,
186192
requireJwt,

0 commit comments

Comments
 (0)