fix: slack integration workflow (#2675)

* fix: slack integration workflow

* dev: add slack client id as configuration

* fix: clean up

* fix: added env to turbo

---------

Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
This commit is contained in:
Nikhil 2023-11-06 21:00:49 +05:30 committed by GitHub
parent 984b36f45a
commit b372ccfdb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 99 additions and 99 deletions

View file

@ -1,23 +0,0 @@
import axios from "axios";
import { NextApiRequest, NextApiResponse } from "next";
export default async function handleSlackAuthorize(req: NextApiRequest, res: NextApiResponse) {
try {
const { code } = req.body;
if (!code || code === "") return res.status(400).json({ message: "Code is required" });
const response = await axios({
method: "post",
url: process.env.SLACK_OAUTH_URL || "",
params: {
client_id: process.env.SLACK_CLIENT_ID,
client_secret: process.env.SLACK_CLIENT_SECRET,
code,
},
});
res.status(200).json(response?.data);
} catch (error) {
res.status(200).json({ message: "Internal Server Error" });
}
}