@slack/oauth
Advanced tools
Comparing version 2.5.1 to 2.5.2
@@ -292,3 +292,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var errorMessage, _installOptions, _printableOptions, shouldProceed, state, url, body, e_1, message; | ||
var errorMessage, _installOptions, _printableOptions, shouldProceed, state, stateCookie, existingCookies, allCookies, url, body, e_1, message; | ||
return __generator(this, function (_a) { | ||
@@ -325,3 +325,22 @@ switch (_a.label) { | ||
state = _a.sent(); | ||
res.setHeader('Set-Cookie', this.buildSetCookieHeaderForNewState(state)); | ||
stateCookie = this.buildSetCookieHeaderForNewState(state); | ||
if (res.getHeader('Set-Cookie')) { | ||
existingCookies = res.getHeader('Set-Cookie') || []; | ||
allCookies = []; | ||
if (Array.isArray(existingCookies)) { | ||
allCookies.push.apply(allCookies, existingCookies); | ||
} | ||
else if (typeof existingCookies === 'string') { | ||
allCookies.push(existingCookies); | ||
} | ||
else { | ||
allCookies.push(existingCookies.toString()); | ||
} | ||
// Append the state cookie | ||
allCookies.push(stateCookie); | ||
res.setHeader('Set-Cookie', allCookies); | ||
} | ||
else { | ||
res.setHeader('Set-Cookie', stateCookie); | ||
} | ||
return [4 /*yield*/, this.generateInstallUrl(_installOptions, this.stateVerification, state)]; | ||
@@ -328,0 +347,0 @@ case 5: |
{ | ||
"name": "@slack/oauth", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"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
191147
2126