Major improvements to how connections are managed, also interfaces, interfaces EVERYWHERE

This commit is contained in:
Eclypsed
2024-02-02 03:05:42 -05:00
parent 909b78807f
commit 20454e22d1
12 changed files with 183 additions and 140 deletions

View File

@@ -7,7 +7,7 @@ export const handle: Handle = async ({ event, resolve }) => {
const urlpath = event.url.pathname
if (urlpath.startsWith('/api') && event.request.headers.get('apikey') !== SECRET_INTERNAL_API_KEY && event.url.searchParams.get('apikey') !== SECRET_INTERNAL_API_KEY) {
return new Response('Unauthorized', { status: 400 })
return new Response('Unauthorized', { status: 401 })
}
if (!nonJwtProtectedRoutes.some((route) => urlpath.startsWith(route))) {