|
|
@@ -32,9 +32,13 @@ module.exports = (crowi) => {
|
|
|
return next();
|
|
|
}
|
|
|
|
|
|
- router.post('/', /* verificationRequestUrl, /* verificationAccessToken, */ async(req, res) => {
|
|
|
+ const slackbotSigningSecret = (req, res, next) => {
|
|
|
+ req.signingSecret = crowi.configManager.getConfig('crowi', 'slackbot:signingSecret');
|
|
|
+ return next();
|
|
|
+ };
|
|
|
+
|
|
|
+ router.post('/', slackbotSigningSecret, verifyingIsSlackRequest, /* verificationRequestUrl, /* verificationAccessToken, */ async(req, res) => {
|
|
|
|
|
|
- verifyingIsSlackRequest(req, res, crowi.configManager.getConfig('crowi', 'slackbot:signingSecret'));
|
|
|
|
|
|
// Send response immediately to avoid opelation_timeout error
|
|
|
// See https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
|
|
|
@@ -98,7 +102,7 @@ module.exports = (crowi) => {
|
|
|
|
|
|
router.post('/interactive', verificationRequestUrl, async(req, res) => {
|
|
|
|
|
|
- verifyingIsSlackRequest(req, res, crowi.configManager.getConfig('crowi', 'slackbot:signingSecret'));
|
|
|
+ // verifyingIsSlackRequest(req, res, crowi.configManager.getConfig('crowi', 'slackbot:signingSecret'));
|
|
|
|
|
|
// Send response immediately to avoid opelation_timeout error
|
|
|
// See https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
|