Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf2611db

Browse files
authored
Merge pull request#136 from jasonLaster/use-commonjs
Switch to commonjs
2 parents51e7059 +8d26857 commitf2611db

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

‎auth0.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// this is a hack to improve DX
22
// TODO: figure out a better way
33

4-
export{Auth0}from"./dist/auth0";
4+
const{ Auth0}=require("./dist/auth0")
5+
module.exports={ Auth0}

‎examples/useauth-create-next-app/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"next":"9.3.2",
1313
"react":"16.10.2",
1414
"react-dom":"16.10.2",
15-
"react-use-auth":"^0.5.1",
15+
"react-use-auth":"2.0.2",
1616
"rebass":"^4.0.6"
1717
}
1818
}
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
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";
44
import{useRouter}from"next/router";
55

66
functionMyApp({ Component, pageProps}){
77
constrouter=useRouter();
8-
98
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+
/>
1518
<Component{...pageProps}/>
16-
</AuthProvider>
19+
</>
1720
);
1821
}
1922

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp