How to use the msal/lib-commonjs/error/ClientAuthError.ClientAuthErrorMessage.userCancelledError function in msal

To help you get started, we’ve selected a few msal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dotnet / aspnetcore / src / Components / WebAssembly / Authentication.Msal / src / Interop / AuthenticationService.ts View on Github external
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;
            }
        }
    }