separate public client id from auth secret

This commit is contained in:
2026-09-06 17:35:40 +03:00
parent 0958d90408
commit 887cd5872f
+2 -3
View File
@@ -11,10 +11,9 @@ import https from 'node:https';
const CLIENT_ID = () => process.env.GOOGLE_CLIENT_ID || null; const CLIENT_ID = () => process.env.GOOGLE_CLIENT_ID || null;
const AUTH_SECRET = () => { const AUTH_SECRET = () => {
const configured = process.env.AUTH_SECRET || process.env.GOOGLE_CLIENT_ID; if (process.env.AUTH_SECRET) return process.env.AUTH_SECRET;
if (configured) return configured;
if (process.env.NODE_ENV === 'production') throw new Error('Üretimde AUTH_SECRET zorunludur.'); 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 const TOKEN_TTL_SEC = 30 * 24 * 60 * 60; // 30 gün