From 887cd5872f36773abb527707f38f99b5d2d1f7f2 Mon Sep 17 00:00:00 2001 From: ht Date: Sun, 6 Sep 2026 17:35:40 +0300 Subject: [PATCH] separate public client id from auth secret --- server/auth.mjs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/auth.mjs b/server/auth.mjs index 074099e..847e4d0 100644 --- a/server/auth.mjs +++ b/server/auth.mjs @@ -11,10 +11,9 @@ import https from 'node:https'; const CLIENT_ID = () => process.env.GOOGLE_CLIENT_ID || null; const AUTH_SECRET = () => { - const configured = process.env.AUTH_SECRET || process.env.GOOGLE_CLIENT_ID; - if (configured) return configured; + if (process.env.AUTH_SECRET) return process.env.AUTH_SECRET; if (process.env.NODE_ENV === 'production') throw new Error('Üretimde AUTH_SECRET zorunludur.'); - return 'ihaleist-dev-secret'; + return process.env.GOOGLE_CLIENT_ID || 'ihaleist-dev-secret'; }; const TOKEN_TTL_SEC = 30 * 24 * 60 * 60; // 30 gün