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:
parent
984b36f45a
commit
b372ccfdb3
10 changed files with 99 additions and 99 deletions
|
|
@ -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" });
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue