new things.
This commit is contained in:
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user