File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ const AUTH0_OPTIONS = {
3030 domain: AUTH_CLIENT_DOMAIN ,
3131}
3232
33- // You can handle the credentials obtained in auth0 and store them in the async store or another store of your choice
33+ // You can handle the credentials obtained in auth0
34+ // and store them in the async store or another store of your choice
3435const CREDENTIALS_HANDLER = {
3536 save : async (credentials ): Promise <void > => {
3637 const value = JSON .stringify (credentials );
@@ -49,3 +50,20 @@ const CREDENTIALS_HANDLER = {
4950export const client = new Auth0Native (AUTH0_OPTIONS , CREDENTIALS_HANDLER );
5051```
5152
53+ Then import the client and pass through props to the provider:
54+
55+ ``` tsx
56+ import { AuthProvider } from ' @cobuildlab/react-native-auth0' ;
57+ import { client } from ' ./config' ;
58+
59+
60+ const AUTH0_SCOPE = ' offline_access email openid profile' ;
61+
62+ export const App = () => (
63+ <AuthProvider
64+ client = { auth0NativeClient }
65+ scope = { AUTH0_SCOPE } >
66+ <App />
67+ </AuthProvider >
68+ );
69+ ```
You can’t perform that action at this time.
0 commit comments