diff options
author | Thesourtimes <cckhmck@gmail.com> | 2021-12-05 21:53:58 +0300 |
---|---|---|
committer | Thesourtimes <cckhmck@gmail.com> | 2021-12-05 21:53:58 +0300 |
commit | 6e488833544ee124048bf01bcd8c787242c7b8a5 (patch) | |
tree | 758f88ab2ad3469d83f3771fa73e05c796f9ee5a /api | |
parent | Make INTERNAL_EMPLOYEE_ONLY functional (diff) | |
download | server-6e488833544ee124048bf01bcd8c787242c7b8a5.tar.xz |
Minor API work
Diffstat (limited to 'api')
-rw-r--r-- | api/src/middlewares/Authentication.ts | 8 | ||||
-rw-r--r-- | api/src/middlewares/TestClient.ts | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/api/src/middlewares/Authentication.ts b/api/src/middlewares/Authentication.ts index 8fbdd2b7..20ba42d8 100644 --- a/api/src/middlewares/Authentication.ts +++ b/api/src/middlewares/Authentication.ts @@ -3,17 +3,25 @@ import { HTTPError } from "lambert-server"; import { checkToken, Config, Rights } from "@fosscord/util"; export const NO_AUTHORIZATION_ROUTES = [ + //Authentication routes "/auth/login", "/auth/register", + "/auth/location-metadata", + //Routes with a seperate auth system "/webhooks/", + //Public information endpoints "/ping", "/gateway", "/experiments", + //Public kubernetes integration "/-/readyz", "/-/healthz", + //Client nalytics "/science", "/track", + //Public policy pages "/policies/instance", + //Asset delivery /\/guilds\/\d+\/widget\.(json|png)/ ]; diff --git a/api/src/middlewares/TestClient.ts b/api/src/middlewares/TestClient.ts index b50f4e5c..6167d9fd 100644 --- a/api/src/middlewares/TestClient.ts +++ b/api/src/middlewares/TestClient.ts @@ -87,8 +87,9 @@ export default function TestClient(app: Application) { res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24); res.set("content-type", "text/html"); + if(req.url.startsWith("/api")) return; if (req.url.startsWith("/invite")) return res.send(html.replace("9b2b7f0632acd0c5e781", "9f24f709a3de09b67c49")); res.send(html); }); -} +} \ No newline at end of file |