Add Slack oauth trigger

This commit is contained in:
Jonathan Cremin 2018-04-19 22:35:51 +01:00
parent 815d1a4dcd
commit 95e7eff734
2 changed files with 5 additions and 0 deletions

View file

@ -16,6 +16,10 @@ const queue = kue.createQueue({
const slackToken = process.env.SLACK_TOKEN;
export default async function (ctx) {
if (ctx.request.method === 'GET') {
ctx.redirect('https://slack.com/oauth/authorize?client_id=349358389361.349904899522&team=TA9AJBFAM&install_redirect=general&scope=links:read,chat:write:bot');
return;
}
if (ctx.request.body.challenge) {
ctx.body = ctx.request.body.challenge;
return;