-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.js
26 lines (24 loc) · 1.05 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module.exports = Franz => class MicrosoftTeams extends Franz {
overrideUserAgent() {
return window.navigator.userAgent.replace(/(Franz|Electron)([^\s]+\s)/g, '').replace(/(Chrome\/)([^ ]*)/g, '$163.0.3239.84');
}
// https://docs.microsoft.com/en-us/microsoftteams/troubleshoot/teams-sign-in/sign-in-loop#resolution
knownCertificateHosts() {
return [
'microsoft.com',
'microsoftonline.com',
'teams.skype.com',
'teams.microsoft.com',
'sfbassets.com',
'skypeforbusiness.com',
];
}
// we need to allow all cookies for ms teams
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`;
}
callback({ cancel: false, responseHeaders: details.responseHeaders });
}
};