add env LEGACY_CRYPTO

This commit is contained in:
Dave Horton committed 2021-11-29 09:02:28 -05:00
1 parent f1d7dcc6d2
commit 19a55a5774
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
const crypto = require('crypto');
const algorithm = 'aes-256-cbc';
const algorithm = process.env.LEGACY_CRYPTO ? 'aes-256-ctr' : 'aes-256-cbc';
const iv = crypto.randomBytes(16);
const secretKey = crypto.createHash('sha256')
.update(String(process.env.JWT_SECRET))