Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

Commit 0051745

Browse files
committed
use cookie key and iv as statics
1 parent 4df400a commit 0051745

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@ exports.creds = {
7070
// Required if `useCookieInsteadOfSession` is set to true. You can provide multiple set of key/iv pairs for key
7171
// rollover purpose. We always use the first set of key/iv pair to encrypt cookie, but we will try every set of
7272
// key/iv pair to decrypt cookie. Key can be any string of length 32, and iv can be any string of length 12.
73+
// Example: openssl rand -base64 12 && openssl rand -base64 32
7374
cookieEncryptionKeys: [
7475
{
75-
'key': process.env.NODE_ENV == "development" ? "TfGVn2Sn3WjFk3GNzvIvOw8aXh16NqFC" : makeSecret(32),
76-
'iv': process.env.NODE_ENV == "development" ? "C1fRcgVZs1K7" : makeSecret(12)
76+
'key': process.env.NODE_ENV == "development" ? "TfGVn2Sn3WjFk3GNzvIvOw8aXh16NqFC" : process.env.COOKIE_KEY, // len 32
77+
'iv': process.env.NODE_ENV == "development" ? "C1fRcgVZs1K7" : process.env.COOKIE_IV // len 12
7778
},
7879
],
7980

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "linkry-link-shortener",
3-
"version": "1.2.1",
3+
"version": "1.3.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)