Skip to content

Commit 5ab3f8c

Browse files
committed
Merge branch 'main' of https://github.com/Azure-Samples/ms-identity-ciam-javascript-tutorial into ch-1-electron-signin
2 parents b02e333 + fc84c42 commit 5ab3f8c

7 files changed

Lines changed: 6741 additions & 9062 deletions

File tree

1-Authentication/1-sign-in-react/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,13 @@ To provide feedback on or suggest features for Azure Active Directory, visit [Us
211211
MSAL React should be instantiated outside of the component tree to prevent it from being re-instantiated on re-renders. After instantiation, pass it as props to your application.
212212

213213
```javascript
214+
import { createRoot } from 'react-dom/client';
215+
214216
const msalInstance = new PublicClientApplication(msalConfig);
215217

216-
ReactDOM.render(
217-
<React.StrictMode>
218-
<App msalInstance={msalInstance}/>
219-
</React.StrictMode>,
220-
document.getElementById("root")
218+
const root = createRoot(document.getElementById('root'));
219+
root.render(
220+
<App instance={msalInstance}/>
221221
);
222222

223223
export default function App({msalInstance}) {

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

Lines changed: 6690 additions & 9021 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: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@azure/msal-browser": "^3.16.0",
7-
"@azure/msal-react": "^2.0.18",
8-
"@testing-library/jest-dom": "^6.4.5",
6+
"@azure/msal-browser": "^3.17.0",
7+
"@azure/msal-react": "^2.0.19",
8+
"@testing-library/jest-dom": "^6.4.6",
99
"@testing-library/react": "^16.0.0",
1010
"@testing-library/user-event": "^14.5.2",
1111
"bootstrap": "^5.3.3",
@@ -29,6 +29,11 @@
2929
"react-app/jest"
3030
]
3131
},
32+
"jest": {
33+
"transformIgnorePatterns": [
34+
"node_modules/(?!(@azure/msal-browser|@azure/msal-react)/)"
35+
]
36+
},
3237
"browserslist": {
3338
"production": [
3439
">0.2%",

1-Authentication/1-sign-in-react/SPA/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import ReactDOM from 'react-dom/client';
2+
import { createRoot } from 'react-dom/client';
33
import App from './App';
44
import { PublicClientApplication, EventType } from '@azure/msal-browser';
55
import { msalConfig } from './authConfig';
@@ -27,7 +27,7 @@ msalInstance.addEventCallback((event) => {
2727
}
2828
});
2929

30-
const root = ReactDOM.createRoot(document.getElementById('root'));
30+
const root = createRoot(document.getElementById('root'));
3131
root.render(
3232
<App instance={msalInstance}/>
3333
);

1-Authentication/1-sign-in-react/SPA/src/sample.test.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from 'react';
2-
import ReactDOM from 'react-dom';
1+
import { React, act } from 'react';
2+
import { createRoot } from 'react-dom/client';
33
import { waitFor } from '@testing-library/react';
44

55
import App from './App';
@@ -51,12 +51,14 @@ describe('Ensure that the app starts', () => {
5151
});
5252

5353
it('should render the app without crashing', async () => {
54-
const div = document.createElement('div');
55-
56-
ReactDOM.render(<App msalInstance={pca} />, div);
54+
const container = document.createElement('div');
55+
document.body.appendChild(container);
56+
act(() => {
57+
createRoot(container).render(<App instance={pca} />);
58+
});
5759

5860
await waitFor(() => expect(handleRedirectSpy).toHaveBeenCalledTimes(1));
5961

60-
expect(div.textContent).toContain('Welcome to the Microsoft Authentication Library For React Tutorial');
62+
expect(container.textContent).toContain('Welcome to the Microsoft Authentication Library For React Tutorial');
6163
});
6264
});

1-Authentication/2-sign-in-angular/SPA/angular.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,8 @@
9999
}
100100
}
101101
}
102+
},
103+
"cli": {
104+
"analytics": false
102105
}
103106
}

1-Authentication/2-sign-in-angular/SPA/package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,33 @@
1111
},
1212
"private": true,
1313
"dependencies": {
14-
"@angular/animations": "^14.2.0",
15-
"@angular/cdk": "^13.0.0",
16-
"@angular/common": "^14.2.0",
17-
"@angular/compiler": "^14.2.0",
18-
"@angular/core": "^14.2.0",
19-
"@angular/forms": "^14.2.0",
20-
"@angular/material": "^13.0.0",
21-
"@angular/platform-browser": "^14.2.0",
22-
"@angular/platform-browser-dynamic": "^14.2.0",
23-
"@angular/router": "^14.2.0",
24-
"@azure/msal-angular": "^2.5.7",
25-
"@azure/msal-browser": "^2.37.0",
26-
"rxjs": "~7.5.0",
27-
"tslib": "^2.3.0",
28-
"zone.js": "~0.11.4"
14+
"@angular/animations": "^18.0.2",
15+
"@angular/cdk": "^18.0.2",
16+
"@angular/common": "^18.0.2",
17+
"@angular/compiler": "^18.0.2",
18+
"@angular/core": "^18.0.2",
19+
"@angular/forms": "^18.0.2",
20+
"@angular/material": "^18.0.2",
21+
"@angular/platform-browser": "^18.0.2",
22+
"@angular/platform-browser-dynamic": "^18.0.2",
23+
"@angular/router": "^18.0.2",
24+
"@azure/msal-angular": "^3.0.19",
25+
"@azure/msal-browser": "^3.16.0",
26+
"rxjs": "~7.8.1",
27+
"tslib": "^2.6.3",
28+
"zone.js": "~0.14.7"
2929
},
3030
"devDependencies": {
31-
"@angular-devkit/build-angular": "^14.2.10",
32-
"@angular/cli": "~14.2.10",
33-
"@angular/compiler-cli": "^14.2.0",
34-
"@types/jasmine": "~4.0.0",
35-
"jasmine-core": "~4.3.0",
36-
"karma": "~6.4.0",
37-
"karma-chrome-launcher": "~3.1.0",
38-
"karma-coverage": "~2.2.0",
31+
"@angular-devkit/build-angular": "^18.0.3",
32+
"@angular/cli": "~18.0.3",
33+
"@angular/compiler-cli": "^18.0.2",
34+
"@types/jasmine": "~5.1.4",
35+
"jasmine-core": "~5.1.2",
36+
"karma": "~6.4.3",
37+
"karma-chrome-launcher": "~3.2.0",
38+
"karma-coverage": "~2.2.1",
3939
"karma-jasmine": "~5.1.0",
40-
"karma-jasmine-html-reporter": "~2.0.0",
41-
"typescript": "~4.7.2"
40+
"karma-jasmine-html-reporter": "~2.1.0",
41+
"typescript": "~5.4.5"
4242
}
4343
}

0 commit comments

Comments
 (0)