new things.

This commit is contained in:
2025-09-12 20:45:48 -04:00
parent c2eb111291
commit 5934f1a91c
11 changed files with 43 additions and 13 deletions

View File

@@ -7,6 +7,7 @@ import Server from "../server/server.ts";
import { TokenFormat } from "../server/platforms/types.ts";
import { HTTPStatus, httpStatusText } from "@oneday/http-status";
import { ContentfulStatusCode } from "@hono/hono/utils/http-status";
import { env } from "../env.ts";
const log = new Logging("APIUtils");
@@ -33,7 +34,7 @@ const authHeaderSchema = z.string().transform((arg, ctx) => {
return split[1];
});
export async function authenticate(c: Context<HonoEnv>, nxt: Next) {
const secret = Deno.env.get('SECRET');
const secret = env["SECRET"];
if (!secret) return c.json(genericResponse(false, "Internal Server Error"), 500);
const authHeader = authHeaderSchema.safeParse(c.req.header('Authorization'));