@tiledesk/tiledesk-server 2.7.4 → 2.7.5
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +3 -0
- package/package.json +1 -1
- package/routes/auth.js +7 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/routes/auth.js
CHANGED
@@ -33,6 +33,12 @@ if (pKey) {
|
|
33
33
|
configSecret = pKey.replace(/\\n/g, '\n');
|
34
34
|
}
|
35
35
|
|
36
|
+
let pubConfigSecret = process.env.GLOBAL_SECRET || config.secret;
|
37
|
+
var pubKey = process.env.GLOBAL_SECRET_OR_PUB_KEY;
|
38
|
+
if (pubKey) {
|
39
|
+
pubConfigSecret = pKey.replace(/\\n/g, '\n');
|
40
|
+
}
|
41
|
+
|
36
42
|
var recaptcha = require('../middleware/recaptcha');
|
37
43
|
|
38
44
|
|
@@ -79,7 +85,7 @@ router.post('/signup',
|
|
79
85
|
if (req.headers.authorization) {
|
80
86
|
|
81
87
|
let token = req.headers.authorization.split(" ")[1];
|
82
|
-
let decode = jwt.verify(token,
|
88
|
+
let decode = jwt.verify(token, pubConfigSecret)
|
83
89
|
if (decode && (decode.email === process.env.ADMIN_EMAIL)) {
|
84
90
|
skipVerificationEmail = true;
|
85
91
|
winston.verbose("skip sending verification email")
|