Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async signInCore(request: Msal.AuthenticationParameters): Promise {
try {
return await this._msalApplication.loginPopup(request);
} catch (e) {
// If the user explicitly cancelled the pop-up, avoid performing a redirect.
if (this.isMsalError(e) && e.errorCode !== ClientAuthErrorMessage.userCancelledError.code) {
try {
this._msalApplication.loginRedirect(request);
} catch (e) {
return e;
}
} else {
return e;
}
}
}