Skip to content

Commit

Permalink
Fix login loop
Browse files Browse the repository at this point in the history
Setting `SameSite=None` also requires setting `Secure`, see https://web.dev/samesite-cookies-explained/#samesite=none-must-be-secure.

Fixes meetfranz#4
  • Loading branch information
tlinhart authored Jun 5, 2023
1 parent fb76f0f commit 79b7c0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = Franz => class MicrosoftTeams extends Franz {
onHeadersReceived(details, callback) {
if (details.responseHeaders && details.responseHeaders['Set-Cookie'] && details.responseHeaders['Set-Cookie'].length && !details.responseHeaders['Set-Cookie'][0].includes('SameSite=none')) {
// eslint-disable-next-line no-param-reassign
details.responseHeaders['Set-Cookie'][0] = `${details.responseHeaders['Set-Cookie'][0]}; SameSite=none`;
details.responseHeaders['Set-Cookie'][0] = `${details.responseHeaders['Set-Cookie'][0]}; SameSite=none; Secure`;
}
callback({ cancel: false, responseHeaders: details.responseHeaders });
}
Expand Down

0 comments on commit 79b7c0d

Please sign in to comment.