Move existing integration authorization and creation into separate steps

This commit is contained in:
Tuan Dang
2023-02-07 23:10:31 +07:00
parent 5ea5887146
commit 679b1d9c23
32 changed files with 1766 additions and 428 deletions
-12
View File
@@ -43,9 +43,7 @@ const handleOAuthExchangeHelper = async ({
code: string;
environment: string;
}) => {
let action;
let integrationAuth;
// let newIntegration;
try {
const bot = await Bot.findOne({
workspace: workspaceId,
@@ -100,16 +98,6 @@ const handleOAuthExchangeHelper = async ({
accessExpiresAt: res.accessExpiresAt
});
}
// // initialize new integration after exchange
// newIntegration = await new Integration({
// workspace: workspaceId,
// isActive: false,
// app: null,
// environment,
// integration,
// integrationAuth: integrationAuth._id
// }).save();
} catch (err) {
Sentry.setUser(null);
Sentry.captureException(err);