Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/mgt-msal2-provider

Package Overview
Dependencies
Maintainers
0
Versions
741
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/mgt-msal2-provider - npm Package Compare versions

Comparing version 4.2.5 to 4.3.0-preview.9666b8b

23

dist/es6/Msal2Provider.js

@@ -17,3 +17,3 @@ /**

import { IProvider, LoginType, ProviderState, createFromProvider } from '@microsoft/mgt-element';
import { PublicClientApplication, InteractionRequiredAuthError } from '@azure/msal-browser';
import { PublicClientApplication, InteractionRequiredAuthError, BrowserAuthError } from '@azure/msal-browser';
/**

@@ -245,4 +245,21 @@ * Prompt type enum

if (this._loginType === LoginType.Popup) {
const response = yield this._publicClientApplication.loginPopup(loginRequest);
this.handleResponse(response === null || response === void 0 ? void 0 : response.account);
try {
const response = yield this._publicClientApplication.loginPopup(loginRequest);
this.handleResponse(response === null || response === void 0 ? void 0 : response.account);
}
catch (error) {
switch (true) {
case error instanceof BrowserAuthError && error.errorCode === 'user_cancelled':
console.warn('🦒: User cancelled the login flow.');
this.setState(ProviderState.SignedOut);
break;
case error instanceof BrowserAuthError && error.errorCode === 'interaction_in_progress':
console.warn('🦒: Login already in progess. Close the popup to login again.');
this.setState(ProviderState.SignedOut);
break;
default:
console.error('🦒: Error occurred during login:', error);
throw error;
}
}
}

@@ -249,0 +266,0 @@ else {

6

package.json
{
"name": "@microsoft/mgt-msal2-provider",
"version": "4.2.5",
"version": "4.3.0-preview.9666b8b",
"description": "The Microsoft Graph Toolkit Msal 2.0 Provider",

@@ -47,4 +47,4 @@ "keywords": [

"@azure/msal-browser": "^2.38.3",
"@microsoft/mgt-element": "4.2.5",
"@microsoft/microsoft-graph-client": "3.0.2"
"@microsoft/mgt-element": "4.3.0-preview.9666b8b",
"@microsoft/microsoft-graph-client": "3.0.7"
},

@@ -51,0 +51,0 @@ "publishConfig": {

@@ -27,3 +27,4 @@ /**

EventMessage,
AuthenticationResult
AuthenticationResult,
BrowserAuthError
} from '@azure/msal-browser';

@@ -480,4 +481,20 @@ import { AuthenticationProviderOptions } from '@microsoft/microsoft-graph-client';

if (this._loginType === LoginType.Popup) {
const response = await this._publicClientApplication.loginPopup(loginRequest);
this.handleResponse(response?.account);
try {
const response = await this._publicClientApplication.loginPopup(loginRequest);
this.handleResponse(response?.account);
} catch (error) {
switch (true) {
case error instanceof BrowserAuthError && error.errorCode === 'user_cancelled':
console.warn('🦒: User cancelled the login flow.');
this.setState(ProviderState.SignedOut);
break;
case error instanceof BrowserAuthError && error.errorCode === 'interaction_in_progress':
console.warn('🦒: Login already in progess. Close the popup to login again.');
this.setState(ProviderState.SignedOut);
break;
default:
console.error('🦒: Error occurred during login:', error);
throw error;
}
}
} else {

@@ -484,0 +501,0 @@ const loginRedirectRequest: RedirectRequest = { ...loginRequest };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc