mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-25 14:17:31 +00:00
fix(scripts): read the server's .env in the admin reset and the key rotation
Both scripts now load server/.env as the server does, so an install whose TREK_DB_URL lives there resets the admin and rotates the key in its Postgres database instead of in a SQLite file left behind by the move.
This commit is contained in:
@@ -21,6 +21,9 @@ const path = require('path');
|
||||
const crypto = require('crypto');
|
||||
const bcrypt = require('bcryptjs');
|
||||
|
||||
// The server reads its .env too (src/index.ts), so TREK_DB_URL kept there picks the same database here.
|
||||
require('dotenv').config({ path: path.join(__dirname, '.env'), quiet: true });
|
||||
|
||||
// Kept in sync with the seeder/authService cost factor.
|
||||
const BCRYPT_COST = 12;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user