Skip to content

Commit 962d62a

Browse files
committed
fixed msalprovider bug where it was stuck in loading
1 parent 98e7fc6 commit 962d62a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/providers/MsalProvider.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ export class MsalProvider extends IProvider {
4242
}
4343

4444
public async trySilentSignIn() {
45-
if (this._userAgentApplication.isCallback(window.location.hash)) {
46-
return;
47-
}
48-
if (this._userAgentApplication.getAccount() && (await this.getAccessToken(null))) {
49-
this.setState(ProviderState.SignedIn);
50-
} else {
45+
try {
46+
if (this._userAgentApplication.isCallback(window.location.hash)) {
47+
return;
48+
}
49+
if (this._userAgentApplication.getAccount() && (await this.getAccessToken(null))) {
50+
this.setState(ProviderState.SignedIn);
51+
} else {
52+
this.setState(ProviderState.SignedOut);
53+
}
54+
} catch (e) {
5155
this.setState(ProviderState.SignedOut);
5256
}
5357
}

0 commit comments

Comments
 (0)