Shun Miyazawa 4 лет назад
Родитель
Сommit
fca4ecfbee
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      src/server/models/slack-app-integration.js

+ 3 - 3
src/server/models/slack-app-integration.js

@@ -10,9 +10,9 @@ class SlackAppIntegration {
   static generateAccessToken() {
     const hasher1 = crypto.createHash('sha512');
     const hasher2 = crypto.createHash('sha512');
-    const tokenGtoP = hasher1.update(`${new Date().getTime().toString()}proxy`).digest('base64');
-    const tokenPtoG = hasher2.update(`${new Date().getTime().toString()}growi`).digest('base64');
-    return [tokenGtoP, tokenPtoG];
+    const tokenGtoP = hasher1.update(new Date().getTime().toString() + process.env.SALT_FOR_GTOP_TOKEN);
+    const tokenPtoG = hasher2.update(new Date().getTime().toString() + process.env.SALT_FOR_PTOG_TOKEN);
+    return [tokenGtoP.digest('base64'), tokenPtoG.digest('base64')];
   }
 
 }