From 5af67520a83b840aaee24d947239c886a77ea4be Mon Sep 17 00:00:00 2001 From: doyeka Date: Wed, 30 Aug 2023 20:06:54 -0400 Subject: [PATCH] reproduction --- 00-Login-Hooks/App.tsx | 33 +++++++++++++++---- 00-Login-Hooks/README.md | 4 +-- .../ios/Auth0Sample.xcodeproj/project.pbxproj | 6 ++-- 00-Login-Hooks/ios/Auth0Sample/Info.plist | 20 +++++------ 00-Login-Hooks/ios/Podfile.lock | 8 ++--- 5 files changed, 46 insertions(+), 25 deletions(-) diff --git a/00-Login-Hooks/App.tsx b/00-Login-Hooks/App.tsx index e040f09..ef2a7bd 100644 --- a/00-Login-Hooks/App.tsx +++ b/00-Login-Hooks/App.tsx @@ -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({}, {}); @@ -26,9 +42,12 @@ const Home = () => { await clearSession({}, {}); }; - if (isLoading) { - return Loading; + return ( + + Loading + + ); } return ( @@ -68,8 +87,8 @@ const styles = StyleSheet.create({ error: { margin: 20, textAlign: 'center', - color: '#D8000C' - } + color: '#D8000C', + }, }); -export default App; \ No newline at end of file +export default App; diff --git a/00-Login-Hooks/README.md b/00-Login-Hooks/README.md index ed3b327..b6f5c51 100644 --- a/00-Login-Hooks/README.md +++ b/00-Login-Hooks/README.md @@ -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. diff --git a/00-Login-Hooks/ios/Auth0Sample.xcodeproj/project.pbxproj b/00-Login-Hooks/ios/Auth0Sample.xcodeproj/project.pbxproj index da35c3c..e047978 100644 --- a/00-Login-Hooks/ios/Auth0Sample.xcodeproj/project.pbxproj +++ b/00-Login-Hooks/ios/Auth0Sample.xcodeproj/project.pbxproj @@ -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 = ( @@ -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)", @@ -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)", @@ -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)", diff --git a/00-Login-Hooks/ios/Auth0Sample/Info.plist b/00-Login-Hooks/ios/Auth0Sample/Info.plist index 2c74a17..332f731 100644 --- a/00-Login-Hooks/ios/Auth0Sample/Info.plist +++ b/00-Login-Hooks/ios/Auth0Sample/Info.plist @@ -10,6 +10,16 @@ $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleSignature + ???? CFBundleURLTypes @@ -23,16 +33,6 @@ - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(MARKETING_VERSION) - CFBundleSignature - ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS diff --git a/00-Login-Hooks/ios/Podfile.lock b/00-Login-Hooks/ios/Podfile.lock index ad7cb5f..392b86b 100644 --- a/00-Login-Hooks/ios/Podfile.lock +++ b/00-Login-Hooks/ios/Podfile.lock @@ -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) @@ -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