Skip to content

Commit 1d271cc

Browse files
authored
Merge pull request #105 from Azure-Samples/algo-1/fix-vulnerabilities
Algo 1/fix vulnerabilities
2 parents 32cd776 + 810e2e9 commit 1d271cc

23 files changed

Lines changed: 25858 additions & 29814 deletions

File tree

1-Authentication/0-sign-in-vanillajs/App/package-lock.json

Lines changed: 660 additions & 289 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

1-Authentication/0-sign-in-vanillajs/App/public/authPopup.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
// Create the main myMSALObj instance
22
// configuration parameters are located at authConfig.js
3-
const myMSALObj = new msal.PublicClientApplication(msalConfig);
4-
5-
myMSALObj.initialize().then(() => {
6-
/**
7-
* A promise handler needs to be registered for handling the
8-
* response returned from redirect flow. For more information, visit:
9-
* https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/initialization.md#redirect-apis
10-
*/
11-
myMSALObj.handleRedirectPromise()
12-
.then(handleResponse)
13-
.catch((error) => {
14-
console.error(error);
15-
});
3+
let myMSALObj;
4+
5+
msal.PublicClientApplication.createPublicClientApplication(msalConfig)
6+
.then((obj) => {
7+
myMSALObj = obj;
8+
})
9+
.catch((error) => {
10+
console.error("Error creating MSAL PublicClientApplication:", error);
1611
});
1712

1813
let username = "";

1-Authentication/0-sign-in-vanillajs/App/public/authRedirect.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
// Create the main myMSALObj instance
22
// configuration parameters are located at authConfig.js
3-
const myMSALObj = new msal.PublicClientApplication(msalConfig);
4-
5-
myMSALObj.initialize().then(() => {
6-
/**
7-
* A promise handler needs to be registered for handling the
8-
* response returned from redirect flow. For more information, visit:
9-
* https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/initialization.md#redirect-apis
10-
*/
11-
myMSALObj.handleRedirectPromise()
12-
.then(handleResponse)
3+
msal.PublicClientApplication.createPublicClientApplication(msalConfig)
4+
.then((obj) => {
5+
myMSALObj = obj;
6+
/**
7+
* A promise handler needs to be registered for handling the
8+
* response returned from redirect flow. For more information, visit:
9+
* https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/initialization.md#redirect-apis
10+
*/
11+
myMSALObj.handleRedirectPromise()
12+
.then(handleResponse)
13+
.catch((error) => {
14+
console.error(error);
15+
});
16+
})
1317
.catch((error) => {
14-
console.error(error);
18+
console.error("Error creating MSAL PublicClientApplication:", error);
1519
});
16-
});
1720

1821
let username = "";
1922

1-Authentication/1-sign-in-react/SPA/package-lock.json

Lines changed: 10917 additions & 8841 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

1-Authentication/1-sign-in-react/SPA/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"dependencies": {
66
"@azure/msal-browser": "^3.17.0",
77
"@azure/msal-react": "^2.0.19",
8+
"@babel/plugin-transform-private-property-in-object": "^7.24.7",
89
"@testing-library/jest-dom": "^6.4.6",
910
"@testing-library/react": "^16.0.0",
1011
"@testing-library/user-event": "^14.5.2",
@@ -14,7 +15,6 @@
1415
"react-dom": "^18.3.1"
1516
},
1617
"devDependencies": {
17-
"@babel/plugin-transform-private-property-in-object": "^7.24.7",
1818
"react-scripts": "^5.0.1"
1919
},
2020
"scripts": {

0 commit comments

Comments
 (0)