|
@@ -8,21 +8,7 @@ module.exports = (crowi) => {
|
|
|
const { boltService } = crowi;
|
|
const { boltService } = crowi;
|
|
|
const requestHandler = boltService.receiver.requestHandler.bind(boltService.receiver);
|
|
const requestHandler = boltService.receiver.requestHandler.bind(boltService.receiver);
|
|
|
|
|
|
|
|
- function accessTokenParserForSlackBot(req, res, next) {
|
|
|
|
|
- const slackBotAccessToken = req.body.slack_bot_access_token || null;
|
|
|
|
|
- if (slackBotAccessToken == null) {
|
|
|
|
|
- next();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (slackBotAccessToken === crowi.configManager.getConfig('crowi', 'slackbot:access-token')) {
|
|
|
|
|
- req.body.user = {
|
|
|
|
|
- username: 'slackBot',
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- next();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- router.post('/', accessTokenParserForSlackBot, async(req, res) => {
|
|
|
|
|
|
|
+ router.post('/', async(req, res) => {
|
|
|
// for verification request URL on Event Subscriptions
|
|
// for verification request URL on Event Subscriptions
|
|
|
if (req.body.type === 'url_verification') {
|
|
if (req.body.type === 'url_verification') {
|
|
|
res.send(req.body);
|
|
res.send(req.body);
|