Skip to content

Commit

Permalink
reproduction
Browse files Browse the repository at this point in the history
  • Loading branch information
doyeka committed Aug 31, 2023
1 parent 19359cc commit 5af6752
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 25 deletions.
33 changes: 26 additions & 7 deletions 00-Login-Hooks/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,29 @@
* @flow strict-local
*/

import React from 'react';
import React, {useEffect} from 'react';
import {Alert, Button, StyleSheet, Text, View} from 'react-native';
import {useAuth0, Auth0Provider} from 'react-native-auth0';
import config from './auth0-configuration';

const Home = () => {
const {authorize, clearSession, user, getCredentials, error, isLoading} = useAuth0();
const {
authorize,
clearSession,
user,
getCredentials,
error,
isLoading,
requireLocalAuthentication,
} = useAuth0();

useEffect(() => {
const biometricAuth = async () => {
await requireLocalAuthentication();
console.log('HERE!');
};
biometricAuth();
});

const onLogin = async () => {
await authorize({}, {});
Expand All @@ -26,9 +42,12 @@ const Home = () => {
await clearSession({}, {});
};


if (isLoading) {
return <View style={styles.container}><Text>Loading</Text></View>;
return (
<View style={styles.container}>
<Text>Loading</Text>
</View>
);
}

return (
Expand Down Expand Up @@ -68,8 +87,8 @@ const styles = StyleSheet.create({
error: {
margin: 20,
textAlign: 'center',
color: '#D8000C'
}
color: '#D8000C',
},
});

export default App;
export default App;
4 changes: 2 additions & 2 deletions 00-Login-Hooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ The `applicationId` value will be auto-replaced at runtime with the package name
5. In the **Allowed Callback URLs** field, paste in the text below and replace `YOUR_DOMAIN` with the **Domain** from above. These URLs are required for the authentication result to be redirected from the browser to the app:

```
com.auth0samples.auth0://YOUR_DOMAIN/ios/com.auth0samples/callback,
com.auth0samples.auth0://YOUR_DOMAIN/android/com.auth0samples/callback
com.auth0samples.auth0://dev-gvgne7gknmed3ydd.us.auth0.com/ios/com.auth0samples/callback,
com.auth0samples.auth0://dev-gvgne7gknmed3ydd.us.auth0.com/android/com.auth0samples/callback
```

6. Add the same values to the **Allowed Logout URLs** field as well. These are required for the browser to redirect back to the app after the user logs out.
Expand Down
6 changes: 4 additions & 2 deletions 00-Login-Hooks/ios/Auth0Sample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = N3965PGTP2;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Auth0Sample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -513,6 +514,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = N3965PGTP2;
INFOPLIST_FILE = Auth0Sample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -580,7 +582,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
Expand Down Expand Up @@ -646,7 +648,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
Expand Down
20 changes: 10 additions & 10 deletions 00-Login-Hooks/ios/Auth0Sample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -23,16 +33,6 @@
</array>
</dict>
</array>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
8 changes: 4 additions & 4 deletions 00-Login-Hooks/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PODS:
- A0Auth0 (3.0.0):
- Auth0 (= 2.4.0)
- Auth0 (= 2.5.0)
- JWTDecode (= 3.1.0)
- React-Core
- SimpleKeychain (= 1.1.0)
- Auth0 (2.4.0):
- Auth0 (2.5.0):
- JWTDecode (~> 3.1)
- SimpleKeychain (~> 1.1)
- boost (1.76.0)
Expand Down Expand Up @@ -669,8 +669,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
A0Auth0: 34a88d6ea01d78133e7d228384d07b840162c7ea
Auth0: 7c454e679f19d160f1f32bf1e9fa095db19f8769
A0Auth0: 1ef7e745d9cd80340fc81b9de7f712f0b467cd21
Auth0: 72f19ad566fdf57f07bf37f828afd0c1570769a5
boost: 57d2868c099736d80fcd648bf211b4431e51a558
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
Expand Down

0 comments on commit 5af6752

Please sign in to comment.