✨ (credentials) Add credentials management menu in workspace settings
Closes #1567
This commit is contained in:
@@ -16,7 +16,12 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (!state) return badRequest(res)
|
||||
const { typebotId, redirectUrl, blockId, workspaceId } = JSON.parse(
|
||||
Buffer.from(state, 'base64').toString()
|
||||
)
|
||||
) as {
|
||||
redirectUrl: string
|
||||
workspaceId: string
|
||||
typebotId?: string
|
||||
blockId?: string
|
||||
}
|
||||
if (req.method === 'GET') {
|
||||
const code = req.query.code as string | undefined
|
||||
if (!workspaceId) return badRequest(res)
|
||||
@@ -55,6 +60,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const { id: credentialsId } = await prisma.credentials.create({
|
||||
data: credentials,
|
||||
})
|
||||
if (!typebotId) return res.redirect(`${redirectUrl.split('?')[0]}`)
|
||||
const typebot = await prisma.typebot.findFirst({
|
||||
where: {
|
||||
id: typebotId,
|
||||
|
||||
Reference in New Issue
Block a user