add refresh token endpoints

This commit is contained in:
Kai Ritthaler 2025-06-19 22:22:28 +02:00 committed by Luisa Bellitto
parent 2360873993
commit ca34f29fab
8 changed files with 235 additions and 35 deletions

View file

@ -9,6 +9,7 @@
"requiredKeys": [
{ "name": "DATABASE_URL", "generated": true },
{ "name": "TOKEN_SECRET", "generated": true },
{ "name": "REFRESH_TOKEN_SECRET", "generated": true },
{
"name": "DB_USER",
"generated": false,

View file

@ -54,9 +54,9 @@ if (fs.existsSync(".env")) {
);
} while (!input || input.length < setting.minLength);
process.env[setting.name] = input;
} else if (setting.name === "TOKEN_SECRET") {
} else if (setting.name === "TOKEN_SECRET" || setting.name === "REFRESH_TOKEN_SECRET") {
// generating a random JWT secret
const jwtSecret: string = crypto.randomBytes(32).toString("hex"); // 64 Zeichen
const jwtSecret: string = crypto.randomBytes(32).toString("hex"); // 64 character
process.env[setting.name] = jwtSecret;
}
}