mirror of
https://github.com/bubblecup-12/VogelSocialMedia.git
synced 2025-07-07 19:18:51 +00:00
add refresh token endpoints
This commit is contained in:
parent
2360873993
commit
ca34f29fab
8 changed files with 235 additions and 35 deletions
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue