import {Platform, NativeModules} from 'react-native';
+ >import { NativeModules, Platform } from 'react-native';
import CredentialsManagerError from './credentialsManagerError';
import LocalAuthenticationStrategy from './localAuthenticationStrategy';
@@ -418,7 +418,7 @@ credentials-manager/index.js
diff --git a/docs/global.html b/docs/global.html
index a3a84117..132b1f26 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -598,7 +598,7 @@ Type:
diff --git a/docs/hooks_auth0-provider.js.html b/docs/hooks_auth0-provider.js.html
index 49e98fa3..88875b81 100644
--- a/docs/hooks_auth0-provider.js.html
+++ b/docs/hooks_auth0-provider.js.html
@@ -370,7 +370,12 @@ hooks/auth0-provider.js
const getCredentials = useCallback(
async (...options) => {
try {
- return await client.credentialsManager.getCredentials(...options);
+ const credentials = await client.credentialsManager.getCredentials(...options);
+ if(credentials.idToken) {
+ const user = getIdTokenProfileClaims(credentials.idToken);
+ dispatch({type: 'SET_USER', user});
+ }
+ return credentials;
} catch (error) {
dispatch({type: 'ERROR', error});
return;
@@ -440,7 +445,7 @@ hooks/auth0-provider.js
diff --git a/docs/hooks_use-auth0.js.html b/docs/hooks_use-auth0.js.html
index 07ac911a..eaf07706 100644
--- a/docs/hooks_use-auth0.js.html
+++ b/docs/hooks_use-auth0.js.html
@@ -305,7 +305,7 @@ hooks/use-auth0.js
diff --git a/docs/index.html b/docs/index.html
index 26fdfe48..cc67c222 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -633,7 +633,7 @@ Expo
To use the SDK with Expo, configure the app at build time by
- providing the domain
and (optionally) the
+ providing the domain
and the
customScheme
values through the
Config PluginExpo
"react-native-auth0",
{
"domain": "YOUR_AUTH0_DOMAIN",
- "customScheme": "YOUR_CUSTOM_SCHEME",
+ "customScheme": "YOUR_CUSTOM_SCHEME"
}
]
]
@@ -675,11 +675,13 @@
Expo
customScheme
- Optional: Custom scheme to build the callback URL with. If not
- provided, uses Application ID for Android and Bundle
- Identifier for iOS. The value provided here should be passed
- to the customScheme
option parameter of the
- authorize
and clearSession
methods
+ Mandatory: Custom scheme to build the callback URL with. The
+ value provided here should be passed to the
+ customScheme
option parameter of the
+ authorize
and clearSession
methods.
+ The custom scheme should be a unique, all lowercase value with
+ no special characters (For example:
+ auth0.YOUR_APP_PACKAGE_NAME_OR_BUNDLE_IDENTIFIER).
@@ -722,23 +724,27 @@ Callback URL(s)
Android
{YOUR_APP_PACKAGE_NAME_OR_CUSTOM_SCHEME}://{YOUR_AUTH0_DOMAIN}/android/{YOUR_APP_PACKAGE_NAME}/callback
+ >{APP_PACKAGE_NAME_OR_CUSTOM_SCHEME}://{AUTH0_DOMAIN}/android/{APP_PACKAGE_NAME}/callback
- Make sure to replace {YOUR_APP_PACKAGE_NAME_OR_CUSTOM_SCHEME} and
- {YOUR_AUTH0_DOMAIN} with the actual values for your application.
+ Make sure to replace {APP_PACKAGE_NAME_OR_CUSTOM_SCHEME} and
+ {AUTH0_DOMAIN} with the actual values for your application. The
+ {APP_PACKAGE_NAME_OR_CUSTOM_SCHEME} value provided should be all
+ lower case.
iOS
{YOUR_BUNDLE_IDENTIFIER_OR_CUSTOM_SCHEME}://{YOUR_AUTH0_DOMAIN}/ios/{YOUR_BUNDLE_IDENTIFIER}/callback
+ >{BUNDLE_IDENTIFIER_OR_CUSTOM_SCHEME}://{AUTH0_DOMAIN}/ios/{BUNDLE_IDENTIFIER}/callback
- Make sure to replace {YOUR_BUNDLE_IDENTIFIER_OR_CUSTOM_SCHEME} and
- {YOUR_AUTH0_DOMAIN} with the actual values for your application.
+ Make sure to replace {BUNDLE_IDENTIFIER_OR_CUSTOM_SCHEME} and
+ {AUTH0_DOMAIN} with the actual values for your application. The
+ {BUNDLE_IDENTIFIER_OR_CUSTOM_SCHEME} value provided should be all
+ lower case.
Next Steps
@@ -851,7 +857,7 @@ Login
const {authorize, user, isLoading, error} = useAuth0();
const login = async () => {
- await authorize();
+ await clearSession(); // clearSession({customScheme: 'CUSTOM_SCHEME') when using Expo or a custom scheme
};
if(isLoading) {
@@ -914,7 +920,7 @@ Logout
const {clearSession, user} = useAuth0();
const logout = async () => {
- await clearSession();
+ await clearSession(); // clearSession({customScheme: 'CUSTOM_SCHEME') when using Expo or a custom scheme
};
return <View>{user && <Button onPress={logout} title="Log out" />}</View>;
@@ -1116,7 +1122,7 @@ Vulnerability Reporting
diff --git a/docs/management_users.js.html b/docs/management_users.js.html
index 3b4486df..5b36829a 100644
--- a/docs/management_users.js.html
+++ b/docs/management_users.js.html
@@ -374,7 +374,7 @@ management/users.js
diff --git a/docs/webauth_index.js.html b/docs/webauth_index.js.html
index 3659765f..3a3caafa 100644
--- a/docs/webauth_index.js.html
+++ b/docs/webauth_index.js.html
@@ -444,7 +444,7 @@ webauth/index.js
diff --git a/package.json b/package.json
index 0c88c3cf..ed41bafc 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "react-native-auth0",
"title": "React Native Auth0",
- "version": "2.17.1",
+ "version": "2.17.2",
"description": "React Native toolkit for Auth0 API",
"main": "index.js",
"scripts": {
diff --git a/src/networking/telemetry.js b/src/networking/telemetry.js
index 4d8f56fa..781463f2 100644
--- a/src/networking/telemetry.js
+++ b/src/networking/telemetry.js
@@ -1 +1 @@
-module.exports = {name: 'react-native-auth0', version: '2.17.1'};
+module.exports = {name: 'react-native-auth0', version: '2.17.2'};