-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.jsx
38 lines (33 loc) · 1.33 KB
/
App.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { Routes, Route } from 'react-router-dom';
import { MsalProvider } from '@azure/msal-react';
import { PageLayout } from './components/PageLayout';
import { Profile } from './pages/Profile';
import { Contacts } from './pages/Contacts';
import { Home } from './pages/Home';
import './styles/App.css';
const Pages = () => {
return (
<Routes>
<Route path="/profile" element={<Profile />} />
<Route path="/contacts" element={<Contacts />} />
<Route path="/" element={<Home />} />
</Routes>
);
};
/**
* msal-react is built on the React context API and all parts of your app that require authentication must be
* wrapped in the MsalProvider component. You will first need to initialize an instance of PublicClientApplication
* then pass this to MsalProvider as a prop. All components underneath MsalProvider will have access to the
* PublicClientApplication instance via context as well as all hooks and components provided by msal-react. For more, visit:
* https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-react/docs/getting-started.md
*/
const App = ({ instance }) => {
return (
<MsalProvider instance={instance}>
<PageLayout>
<Pages />
</PageLayout>
</MsalProvider>
);
};
export default App;