"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.escapeHtml = exports.defaultCallbackFailure = exports.defaultCallbackSuccess = void 0; var errors_1 = require("./errors"); // Default function to call when OAuth flow is successful function defaultCallbackSuccess(installation, _options, _req, res) { var redirectUrl; if (isNotOrgInstall(installation) && installation.appId !== undefined) { // redirect back to Slack native app // Changes to the workspace app was installed to, to the app home redirectUrl = "slack://app?team=".concat(installation.team.id, "&id=").concat(installation.appId); } else if (isOrgInstall(installation)) { // redirect to Slack app management dashboard redirectUrl = "".concat(installation.enterpriseUrl, "manage/organization/apps/profile/").concat(installation.appId, "/workspaces/add"); } else { // redirect back to Slack native app // does not change the workspace the slack client was last in redirectUrl = 'slack://open'; } var browserUrl = redirectUrl; if (isNotOrgInstall(installation)) { browserUrl = "https://app.slack.com/client/".concat(installation.team.id); } var htmlResponse = "\n
\n \n \n \n \nRedirecting to the Slack App... click here. If you use the browser version of Slack, click this link instead.
\n \n