fix: resolve production runtime issues
This commit is contained in:
@@ -4,8 +4,7 @@ import {
|
||||
resolveFolderRemoteDir,
|
||||
REMOTE_HOST,
|
||||
} from "../utils/ssh.ts"
|
||||
|
||||
import {spawn} from "unenv/node/child_process";
|
||||
import { spawn } from "node:child_process"
|
||||
|
||||
const isSafeFolder = (value: string) => /^[a-zA-Z0-9._-]+$/.test(value)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
resolveFolderRemoteDir,
|
||||
REMOTE_HOST,
|
||||
} from "../utils/ssh.ts"
|
||||
import {spawn} from "unenv/node/child_process";
|
||||
import { spawn } from "node:child_process"
|
||||
|
||||
const isSafeFolder = (value: string) => /^[a-zA-Z0-9._-]+$/.test(value)
|
||||
const isSafeFile = (value: string) => /^[a-zA-Z0-9._-]+$/.test(value)
|
||||
|
||||
@@ -16,10 +16,12 @@ export default defineEventHandler((event) => {
|
||||
return
|
||||
}
|
||||
|
||||
const secureCookie = process.env.AUTH_COOKIE_SECURE === "true"
|
||||
|
||||
setCookie(event, "api_auth_token", expectedToken, {
|
||||
httpOnly: true,
|
||||
sameSite: "lax",
|
||||
secure: process.env.NODE_ENV === "production",
|
||||
secure: secureCookie,
|
||||
path: "/"
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user