|
1 | | -importReactfrom"react"; |
2 | | -importAppfrom"next/app"; |
3 | | -import{AuthProvider}from"react-use-auth"; |
| 1 | + |
| 2 | +import{AuthConfig}from"react-use-auth"; |
| 3 | +import{Auth0}from"react-use-auth/auth0"; |
4 | 4 | import{useRouter}from"next/router"; |
5 | 5 |
|
6 | 6 | functionMyApp({ Component, pageProps}){ |
7 | 7 | constrouter=useRouter(); |
8 | | - |
9 | 8 | return( |
10 | | -<AuthProvider |
11 | | -navigate={router.push} |
12 | | -auth0_domain="useauth.auth0.com" |
13 | | -auth0_client_id="GjWNFNOHq1ino7lQNJBwEywa1aYtbIzh" |
14 | | -> |
| 9 | +<> |
| 10 | +<AuthConfig |
| 11 | +authProvider={Auth0} |
| 12 | +navigate={(url)=>router.push(url)} |
| 13 | +params={{ |
| 14 | +domain:"webreplay.us.auth0.com", |
| 15 | +clientID:"E1B33wDDkz0J4mUC2WAVA2552Fj91uux" |
| 16 | +}} |
| 17 | +/> |
15 | 18 | <Component{...pageProps}/> |
16 | | -</AuthProvider> |
| 19 | +</> |
17 | 20 | ); |
18 | 21 | } |
19 | 22 |
|
20 | | -// extend App component and return our function so we can use useRouter :P |
21 | | -exportdefaultclass_AppextendsApp{ |
22 | | -render(){ |
23 | | -return<MyApp{...this.props}/>; |
24 | | -} |
25 | | -} |
| 23 | +exportdefaultMyApp |