Fixes: Slack integration creation
This commit is contained in:
@ -89,8 +89,10 @@ router.get('slack.commands', async ctx => {
|
|||||||
const endpoint = `${process.env.URL || ''}/auth/slack.commands`;
|
const endpoint = `${process.env.URL || ''}/auth/slack.commands`;
|
||||||
const data = await Slack.oauthAccess(code, endpoint);
|
const data = await Slack.oauthAccess(code, endpoint);
|
||||||
const user = await User.find({
|
const user = await User.find({
|
||||||
service: 'slack',
|
where: {
|
||||||
serviceId: data.user_id,
|
service: 'slack',
|
||||||
|
serviceId: data.user_id,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const authentication = await Authentication.create({
|
const authentication = await Authentication.create({
|
||||||
@ -128,8 +130,10 @@ router.get('slack.post', async ctx => {
|
|||||||
const data = await Slack.oauthAccess(code, endpoint);
|
const data = await Slack.oauthAccess(code, endpoint);
|
||||||
|
|
||||||
const user = await User.find({
|
const user = await User.find({
|
||||||
service: 'slack',
|
where: {
|
||||||
serviceId: data.user_id,
|
service: 'slack',
|
||||||
|
serviceId: data.user_id,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const authentication = await Authentication.create({
|
const authentication = await Authentication.create({
|
||||||
|
Reference in New Issue
Block a user