There was an error while loading. Please reload this page.
1 parent 0b99245 commit 51af334Copy full SHA for 51af334
1 file changed
runtime/routes/reload.ts
@@ -1,18 +1,15 @@
1
import { createHandler } from "../middleware.ts";
2
3
-const RELOAD_TOKEN = Deno.env.get("DECO_RELOAD_TOKEN");
+const RELOAD_TOKEN = Deno.env.get("DECO_RELEASE_RELOAD_TOKEN");
4
export const handler = createHandler(async (
5
{ var: state, req },
6
) => {
7
// Parse request body to get the decofile
8
const token = req.header("Authorization")?.split(" ")[1];
9
- if (RELOAD_TOKEN && token !== RELOAD_TOKEN) {
10
- return new Response(
11
- JSON.stringify({ error: "Unauthorized" }),
12
- {
13
- status: 401,
14
- },
15
- );
+ if (!RELOAD_TOKEN || token !== RELOAD_TOKEN) {
+ return new Response(JSON.stringify({ error: "Unauthorized" }), {
+ status: 401,
+ });
16
}
17
let decofile;
18
let revision;
0 commit comments