mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Use 'localhost' as a fallback for hostname
This commit is contained in:
@@ -458,7 +458,8 @@ export function getPasswordSalt() {
|
|||||||
*/
|
*/
|
||||||
export function getCookieSessionName() {
|
export function getCookieSessionName() {
|
||||||
// Get server hostname and hash it to generate a session suffix
|
// Get server hostname and hash it to generate a session suffix
|
||||||
const suffix = crypto.createHash('sha256').update(os.hostname()).digest('hex').slice(0, 8);
|
const hostname = os.hostname() || 'localhost';
|
||||||
|
const suffix = crypto.createHash('sha256').update(hostname).digest('hex').slice(0, 8);
|
||||||
return `session-${suffix}`;
|
return `session-${suffix}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user