Implement basic auth on portal

This commit is contained in:
Dominic Ferrando
2026-06-30 00:24:48 -04:00
parent 9778c05bf0
commit 235c072421
12 changed files with 101 additions and 27 deletions
+5 -2
View File
@@ -9,7 +9,7 @@ import {
PlayerSchema,
} from "@blade-and-brawn/domain"
import { cors } from "@elysiajs/cors";
import { Elysia, NotFoundError, status } from "elysia";
import { Elysia, NotFoundError, status, t } from "elysia";
import {
PrintfulClient,
PrintfulError,
@@ -133,6 +133,9 @@ export const app = new Elysia()
// TODO: protect with api key/token
.group("/products", (app) =>
app
.onBeforeHandle(({ }) => {
// authenticate cookie
})
.group("/sync", (app) =>
app
// Sync status
@@ -163,7 +166,7 @@ export const app = new Elysia()
return { printfulProduct, webflowProduct };
}, {
params: z.object({ printfulProductId: z.coerce.number() })
}),
})
)
// WEBHOOKS