fix(auth): remove hardcoded fallback session secret (fixes #59) (#60)

This commit is contained in:
FuturMix 2026-06-14 13:51:24 +08:00 committed by GitHub
parent 9d2c485071
commit f8040e9736
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -150,7 +150,11 @@ export function getCoinPayOAuthConfig(): CoinPayOAuthConfig | null {
}
function getSessionSecret(): string {
return process.env.LOGICSRC_SESSION_SECRET || process.env.COINPAY_OAUTH_CLIENT_SECRET || "logicsrc-dev-session-secret";
const secret = process.env.LOGICSRC_SESSION_SECRET || process.env.COINPAY_OAUTH_CLIENT_SECRET;
if (!secret) {
throw new Error("LOGICSRC_SESSION_SECRET or COINPAY_OAUTH_CLIENT_SECRET must be set");
}
return secret;
}
export function signSession(payload: Record<string, unknown>): string {