@slack/oauth
Advanced tools
Comparing version 2.5.2 to 2.5.3
@@ -139,3 +139,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var sourceForLogging, queryResult, authResult_1, currentUTCSec_1, tokensToRefresh, errorMessage, installationUpdates_1, refreshResponses, error_1; | ||
var sourceForLogging, queryResult, authResult_1, currentUTCSec_1, tokensToRefresh, errorMessage, refreshResponses, installationUpdates_1, error_1; | ||
var _this = this; | ||
@@ -148,3 +148,3 @@ return __generator(this, function (_e) { | ||
case 1: | ||
_e.trys.push([1, 6, 7, 8]); | ||
_e.trys.push([1, 7, 8, 9]); | ||
this.logger.debug("Starting authorize() execution (source: ".concat(sourceForLogging, ")")); | ||
@@ -189,6 +189,6 @@ return [4 /*yield*/, this.installationStore.fetchInstallation(source, this.logger)]; | ||
} | ||
if (!(authResult_1.botRefreshToken || authResult_1.userRefreshToken)) return [3 /*break*/, 5]; | ||
if (!(authResult_1.botRefreshToken || authResult_1.userRefreshToken)) return [3 /*break*/, 6]; | ||
currentUTCSec_1 = Math.floor(Date.now() / 1000); | ||
tokensToRefresh = detectExpiredOrExpiringTokens(authResult_1, currentUTCSec_1); | ||
if (!(tokensToRefresh.length > 0)) return [3 /*break*/, 5]; | ||
if (!(tokensToRefresh.length > 0)) return [3 /*break*/, 6]; | ||
if (queryResult.authVersion !== 'v2') { | ||
@@ -200,6 +200,7 @@ errorMessage = 'Unexpected data structure detected. ' + | ||
} | ||
installationUpdates_1 = __assign({}, queryResult); | ||
return [4 /*yield*/, this.refreshExpiringTokens(tokensToRefresh)]; | ||
case 3: | ||
refreshResponses = _e.sent(); | ||
if (!refreshResponses.length) return [3 /*break*/, 5]; | ||
installationUpdates_1 = __assign({}, queryResult); | ||
refreshResponses.forEach(function (refreshResp) { | ||
@@ -235,12 +236,15 @@ var tokenType = refreshResp.token_type; | ||
this.logger.debug('Refreshed tokens have been saved in InstallationStore'); | ||
_e.label = 5; | ||
case 5: return [2 /*return*/, authResult_1]; | ||
case 6: | ||
return [3 /*break*/, 6]; | ||
case 5: | ||
this.logger.debug('No tokens were refreshed'); | ||
_e.label = 6; | ||
case 6: return [2 /*return*/, authResult_1]; | ||
case 7: | ||
error_1 = _e.sent(); | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
throw new errors_1.AuthorizationError(error_1.message); | ||
case 7: | ||
case 8: | ||
this.logger.debug("Completed authorize() execution (source: ".concat(sourceForLogging, ")")); | ||
return [7 /*endfinally*/]; | ||
case 8: return [2 /*return*/]; | ||
case 9: return [2 /*return*/]; | ||
} | ||
@@ -247,0 +251,0 @@ }); |
@@ -110,3 +110,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a, _b, _, devDB, _c, _d, _, devDB; | ||
var _a, _b, _1, devDB, _c, _d, _2, devDB; | ||
return __generator(this, function (_e) { | ||
@@ -120,3 +120,3 @@ if (logger !== undefined) { | ||
} | ||
_a = this.devDB, _b = query.enterpriseId, _ = _a[_b], devDB = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]); | ||
_a = this.devDB, _b = query.enterpriseId, _1 = _a[_b], devDB = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]); | ||
this.devDB = devDB; | ||
@@ -128,3 +128,3 @@ } | ||
} | ||
_c = this.devDB, _d = query.teamId, _ = _c[_d], devDB = __rest(_c, [typeof _d === "symbol" ? _d : _d + ""]); | ||
_c = this.devDB, _d = query.teamId, _2 = _c[_d], devDB = __rest(_c, [typeof _d === "symbol" ? _d : _d + ""]); | ||
this.devDB = devDB; | ||
@@ -131,0 +131,0 @@ } |
{ | ||
"name": "@slack/oauth", | ||
"version": "2.5.2", | ||
"version": "2.5.3", | ||
"description": "Official library for interacting with Slack's Oauth endpoints", | ||
@@ -5,0 +5,0 @@ "author": "Slack Technologies, LLC", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
191464
2130