From f3bb3ce5eb9b582010bdf1e9aad98af83973cb29 Mon Sep 17 00:00:00 2001 From: adjoly Date: Tue, 14 Oct 2025 15:02:31 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=F0=9F=94=A8=E3=80=8D=20fix:=20changed?= =?UTF-8?q?=20to=20env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 2 ++ src/api/auth/default.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 8ecbc62..304a913 100644 --- a/.env.example +++ b/.env.example @@ -24,3 +24,5 @@ SMTP_FROM= SMTP_AUTH_USERNAME= SMTP_AUTH_PASSWORD= EMAIL_TO= + +CORS_ORIGIN= diff --git a/src/api/auth/default.js b/src/api/auth/default.js index 0650fa1..a39fc99 100644 --- a/src/api/auth/default.js +++ b/src/api/auth/default.js @@ -24,7 +24,7 @@ authDB.prepareDB(); export default async function(fastify, options) { fastify.register(cors, { - origin: "http://localhost:5173", + origin: process.ENV.CORS_ORIGIN || '*', credentials: true, methods: [ "GET", "POST", "DELETE", "OPTIONS" ] });