Skip to content

Commit 922affc

Browse files
PaulMcManus23sebastienlevertvogtn
authored
Fix for Intermittent Teams 2 provider failure (#1578)
Co-authored-by: Sébastien Levert <[email protected]> Co-authored-by: Sébastien Levert <[email protected]> Co-authored-by: Nicolas Vogt <[email protected]>
1 parent ec0c375 commit 922affc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/providers/mgt-teams-msal2-provider/src/TeamsMsal2Provider.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,14 @@ export class TeamsMsal2Provider extends Msal2Provider {
256256

257257
// make sure we are calling login only once
258258
if (!sessionStorage.getItem(this._sessionStorageLoginInProgress)) {
259-
sessionStorage.setItem(this._sessionStorageLoginInProgress, 'true');
259+
const isInIframe = window.parent !== window;
260+
if (!isInIframe) {
261+
sessionStorage.setItem(this._sessionStorageLoginInProgress, 'true');
262+
} else {
263+
console.warn(
264+
'handleProviderState - Is in iframe... will try to login anyway... but will not set session storage variable'
265+
);
266+
}
260267

261268
provider.login();
262269
}

0 commit comments

Comments
 (0)