Allow Metatron Drive admin panel origin
This commit is contained in:
parent
00147988d7
commit
2266dde52e
@ -4,6 +4,7 @@ DATABASE_URL=postgresql://postgres:postgres@localhost:5432/whats_drive?schema=pu
|
||||
JWT_SECRET=replace-with-at-least-32-random-characters
|
||||
JWT_EXPIRES_IN=7d
|
||||
CORS_ORIGINS=*
|
||||
ADMIN_PANEL_ORIGIN=https://metatron-drive.thedomainnest.com
|
||||
MAX_UPLOAD_MB=250
|
||||
GOOGLE_CREDENTIALS=./credentials.json
|
||||
GOOGLE_TOKEN=./token.json
|
||||
|
||||
@ -10,6 +10,7 @@ const schema = z.object({
|
||||
JWT_SECRET: z.string().min(32),
|
||||
JWT_EXPIRES_IN: z.string().default("7d"),
|
||||
CORS_ORIGINS: z.string().default("*"),
|
||||
ADMIN_PANEL_ORIGIN: z.string().url().default("https://metatron-drive.thedomainnest.com"),
|
||||
MAX_UPLOAD_MB: z.coerce.number().positive().default(250),
|
||||
GOOGLE_CREDENTIALS: z.string().default("./credentials.json"),
|
||||
GOOGLE_TOKEN: z.string().default("./token.json"),
|
||||
@ -34,5 +35,8 @@ export const config = {
|
||||
uploadDirectory: path.resolve(projectRoot, "uploads", "tmp"),
|
||||
corsOrigins: parsed.data.CORS_ORIGINS === "*"
|
||||
? "*"
|
||||
: parsed.data.CORS_ORIGINS.split(",").map((value) => value.trim()).filter(Boolean),
|
||||
: [...new Set([
|
||||
...parsed.data.CORS_ORIGINS.split(",").map((value) => value.trim()).filter(Boolean),
|
||||
parsed.data.ADMIN_PANEL_ORIGIN,
|
||||
])],
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user