@bifold/core 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/inputs/BiometryControl.js +14 -4
- package/lib/commonjs/components/inputs/BiometryControl.js.map +1 -1
- package/lib/commonjs/components/inputs/PINInput.js +6 -2
- package/lib/commonjs/components/inputs/PINInput.js.map +1 -1
- package/lib/commonjs/components/modals/CommonRemoveModal.js +10 -4
- package/lib/commonjs/components/modals/CommonRemoveModal.js.map +1 -1
- package/lib/commonjs/components/modals/DeveloperModal.js.map +1 -1
- package/lib/commonjs/container-impl.js +1 -0
- package/lib/commonjs/container-impl.js.map +1 -1
- package/lib/commonjs/contexts/activity.js +2 -2
- package/lib/commonjs/contexts/activity.js.map +1 -1
- package/lib/commonjs/contexts/auth.js +13 -5
- package/lib/commonjs/contexts/auth.js.map +1 -1
- package/lib/commonjs/hooks/useBifoldAgentSetup.js +31 -3
- package/lib/commonjs/hooks/useBifoldAgentSetup.js.map +1 -1
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/localization/en/en.json +928 -0
- package/lib/commonjs/localization/en/index.js +3 -929
- package/lib/commonjs/localization/en/index.js.map +1 -1
- package/lib/commonjs/localization/fr/fr.json +910 -0
- package/lib/commonjs/localization/fr/index.js +3 -909
- package/lib/commonjs/localization/fr/index.js.map +1 -1
- package/lib/commonjs/localization/pt-br/index.js +3 -886
- package/lib/commonjs/localization/pt-br/index.js.map +1 -1
- package/lib/commonjs/localization/pt-br/pt-br.json +887 -0
- package/lib/commonjs/modules/openid/screens/OpenIDCredentialOffer.js +2 -1
- package/lib/commonjs/modules/openid/screens/OpenIDCredentialOffer.js.map +1 -1
- package/lib/commonjs/screens/NameWallet.js.map +1 -1
- package/lib/commonjs/screens/RenameWallet.js.map +1 -1
- package/lib/commonjs/screens/Settings.js +9 -0
- package/lib/commonjs/screens/Settings.js.map +1 -1
- package/lib/commonjs/screens/Splash.js +8 -8
- package/lib/commonjs/screens/Splash.js.map +1 -1
- package/lib/commonjs/screens/ToggleBiometry.js.map +1 -1
- package/lib/commonjs/services/keychain.js +4 -0
- package/lib/commonjs/services/keychain.js.map +1 -1
- package/lib/module/components/inputs/BiometryControl.js +14 -4
- package/lib/module/components/inputs/BiometryControl.js.map +1 -1
- package/lib/module/components/inputs/PINInput.js +7 -3
- package/lib/module/components/inputs/PINInput.js.map +1 -1
- package/lib/module/components/modals/CommonRemoveModal.js +10 -4
- package/lib/module/components/modals/CommonRemoveModal.js.map +1 -1
- package/lib/module/components/modals/DeveloperModal.js.map +1 -1
- package/lib/module/container-impl.js +1 -0
- package/lib/module/container-impl.js.map +1 -1
- package/lib/module/contexts/activity.js +3 -3
- package/lib/module/contexts/activity.js.map +1 -1
- package/lib/module/contexts/auth.js +12 -4
- package/lib/module/contexts/auth.js.map +1 -1
- package/lib/module/hooks/useBifoldAgentSetup.js +33 -5
- package/lib/module/hooks/useBifoldAgentSetup.js.map +1 -1
- package/lib/module/index.js +3 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/localization/en/en.json +928 -0
- package/lib/module/localization/en/index.js +2 -929
- package/lib/module/localization/en/index.js.map +1 -1
- package/lib/module/localization/fr/fr.json +910 -0
- package/lib/module/localization/fr/index.js +2 -909
- package/lib/module/localization/fr/index.js.map +1 -1
- package/lib/module/localization/pt-br/index.js +2 -886
- package/lib/module/localization/pt-br/index.js.map +1 -1
- package/lib/module/localization/pt-br/pt-br.json +887 -0
- package/lib/module/modules/openid/screens/OpenIDCredentialOffer.js +2 -1
- package/lib/module/modules/openid/screens/OpenIDCredentialOffer.js.map +1 -1
- package/lib/module/screens/NameWallet.js.map +1 -1
- package/lib/module/screens/RenameWallet.js.map +1 -1
- package/lib/module/screens/Settings.js +9 -0
- package/lib/module/screens/Settings.js.map +1 -1
- package/lib/module/screens/Splash.js +9 -9
- package/lib/module/screens/Splash.js.map +1 -1
- package/lib/module/screens/ToggleBiometry.js.map +1 -1
- package/lib/module/services/keychain.js +4 -0
- package/lib/module/services/keychain.js.map +1 -1
- package/lib/typescript/src/components/inputs/BiometryControl.d.ts.map +1 -1
- package/lib/typescript/src/components/inputs/PINInput.d.ts.map +1 -1
- package/lib/typescript/src/components/modals/CommonRemoveModal.d.ts +1 -0
- package/lib/typescript/src/components/modals/CommonRemoveModal.d.ts.map +1 -1
- package/lib/typescript/src/components/modals/DeveloperModal.d.ts.map +1 -1
- package/lib/typescript/src/container-impl.d.ts.map +1 -1
- package/lib/typescript/src/contexts/auth.d.ts +5 -1
- package/lib/typescript/src/contexts/auth.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useBifoldAgentSetup.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/localization/en/index.d.ts +2 -926
- package/lib/typescript/src/localization/en/index.d.ts.map +1 -1
- package/lib/typescript/src/localization/fr/index.d.ts +2 -908
- package/lib/typescript/src/localization/fr/index.d.ts.map +1 -1
- package/lib/typescript/src/localization/pt-br/index.d.ts +2 -885
- package/lib/typescript/src/localization/pt-br/index.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/screens/OpenIDCredentialOffer.d.ts.map +1 -1
- package/lib/typescript/src/screens/NameWallet.d.ts.map +1 -1
- package/lib/typescript/src/screens/RenameWallet.d.ts.map +1 -1
- package/lib/typescript/src/screens/Settings.d.ts.map +1 -1
- package/lib/typescript/src/screens/Splash.d.ts.map +1 -1
- package/lib/typescript/src/screens/ToggleBiometry.d.ts.map +1 -1
- package/lib/typescript/src/services/keychain.d.ts.map +1 -1
- package/lib/typescript/src/theme.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/components/inputs/BiometryControl.tsx +16 -5
- package/src/components/inputs/PINInput.tsx +7 -3
- package/src/components/modals/CommonRemoveModal.tsx +9 -4
- package/src/components/modals/DeveloperModal.tsx +5 -2
- package/src/container-impl.ts +1 -0
- package/src/contexts/activity.tsx +3 -3
- package/src/contexts/auth.tsx +20 -14
- package/src/hooks/useBifoldAgentSetup.ts +40 -7
- package/src/index.ts +3 -1
- package/src/localization/en/en.json +928 -0
- package/src/localization/en/index.ts +2 -927
- package/src/localization/fr/fr.json +910 -0
- package/src/localization/fr/index.ts +2 -909
- package/src/localization/pt-br/index.ts +2 -886
- package/src/localization/pt-br/pt-br.json +887 -0
- package/src/modules/openid/screens/OpenIDCredentialOffer.tsx +1 -0
- package/src/screens/NameWallet.tsx +1 -3
- package/src/screens/RenameWallet.tsx +8 -7
- package/src/screens/Settings.tsx +8 -0
- package/src/screens/Splash.tsx +11 -10
- package/src/screens/ToggleBiometry.tsx +2 -3
- package/src/services/keychain.ts +3 -0
- package/src/theme.ts +9 -9
|
@@ -183,6 +183,7 @@ const OpenIDCredentialOffer: React.FC<OpenIDCredentialDetailsProps> = ({ navigat
|
|
|
183
183
|
visible={isRemoveModalDisplayed}
|
|
184
184
|
onSubmit={handleDeclineTouched}
|
|
185
185
|
onCancel={toggleDeclineModalVisible}
|
|
186
|
+
extraDetails={display.issuer.name}
|
|
186
187
|
/>
|
|
187
188
|
</ScreenLayout>
|
|
188
189
|
)
|
|
@@ -12,14 +12,15 @@ const RenameWallet: React.FC = () => {
|
|
|
12
12
|
navigation.goBack()
|
|
13
13
|
}, [navigation])
|
|
14
14
|
|
|
15
|
-
const onSubmitSuccess = useCallback(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<WalletNameForm isRenaming onCancel={onCancel} onSubmitSuccess={onSubmitSuccess} />
|
|
15
|
+
const onSubmitSuccess = useCallback(
|
|
16
|
+
(name: string) => {
|
|
17
|
+
agent.config.label = name
|
|
18
|
+
navigation.goBack()
|
|
19
|
+
},
|
|
20
|
+
[navigation, agent]
|
|
22
21
|
)
|
|
22
|
+
|
|
23
|
+
return <WalletNameForm isRenaming onCancel={onCancel} onSubmitSuccess={onSubmitSuccess} />
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export default RenameWallet
|
package/src/screens/Settings.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StackScreenProps } from '@react-navigation/stack'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import { useTranslation } from 'react-i18next'
|
|
4
|
+
import { LockoutReason, useAuth } from '../contexts/auth'
|
|
4
5
|
import {
|
|
5
6
|
ScrollView,
|
|
6
7
|
SectionList,
|
|
@@ -33,6 +34,7 @@ type SettingsProps = StackScreenProps<SettingStackParams>
|
|
|
33
34
|
const Settings: React.FC<SettingsProps> = ({ navigation }) => {
|
|
34
35
|
const { t, i18n } = useTranslation()
|
|
35
36
|
const [store] = useStore()
|
|
37
|
+
const { lockOutUser } = useAuth()
|
|
36
38
|
const onDevModeTriggered = () => {
|
|
37
39
|
Vibration.vibrate()
|
|
38
40
|
navigation.navigate(Screens.Developer)
|
|
@@ -216,6 +218,12 @@ const Settings: React.FC<SettingsProps> = ({ navigation }) => {
|
|
|
216
218
|
testID: testIdWithKey('DeveloperOptions'),
|
|
217
219
|
onPress: () => navigation.navigate(Screens.Developer),
|
|
218
220
|
},
|
|
221
|
+
{
|
|
222
|
+
title: t('Settings.Logout'),
|
|
223
|
+
accessibilityLabel: t('Settings.Logout'),
|
|
224
|
+
testID: testIdWithKey('Logout'),
|
|
225
|
+
onPress: () => lockOutUser(LockoutReason.Logout),
|
|
226
|
+
},
|
|
219
227
|
]
|
|
220
228
|
}
|
|
221
229
|
}
|
package/src/screens/Splash.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RemoteOCABundleResolver } from '@bifold/oca/build/legacy'
|
|
2
|
-
import React, { useEffect } from 'react'
|
|
2
|
+
import React, { useEffect, useRef } from 'react'
|
|
3
3
|
import { useTranslation } from 'react-i18next'
|
|
4
4
|
import { DeviceEventEmitter, StyleSheet } from 'react-native'
|
|
5
5
|
import { SafeAreaView } from 'react-native-safe-area-context'
|
|
@@ -27,6 +27,7 @@ const Splash: React.FC<SplashProps> = ({ initializeAgent }) => {
|
|
|
27
27
|
const [store] = useStore()
|
|
28
28
|
const { ColorPallet } = useTheme()
|
|
29
29
|
const { LoadingIndicator } = useAnimatedComponents()
|
|
30
|
+
const initializing = useRef(false)
|
|
30
31
|
const [logger, ocaBundleResolver] = useServices([TOKENS.UTIL_LOGGER, TOKENS.UTIL_OCA_RESOLVER])
|
|
31
32
|
|
|
32
33
|
const styles = StyleSheet.create({
|
|
@@ -39,19 +40,19 @@ const Splash: React.FC<SplashProps> = ({ initializeAgent }) => {
|
|
|
39
40
|
})
|
|
40
41
|
|
|
41
42
|
useEffect(() => {
|
|
43
|
+
if (initializing.current || !store.authentication.didAuthenticate) {
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (!walletSecret) {
|
|
48
|
+
throw new Error('Wallet secret is missing')
|
|
49
|
+
}
|
|
50
|
+
initializing.current = true
|
|
51
|
+
|
|
42
52
|
const initAgentAsyncEffect = async (): Promise<void> => {
|
|
43
53
|
try {
|
|
44
54
|
await (ocaBundleResolver as RemoteOCABundleResolver).checkForUpdates?.()
|
|
45
55
|
|
|
46
|
-
// User hasn't authenticated yet, no point in trying to initialize wallet agent
|
|
47
|
-
if (!store.authentication.didAuthenticate) {
|
|
48
|
-
return
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (!walletSecret) {
|
|
52
|
-
throw new Error('Wallet secret is missing')
|
|
53
|
-
}
|
|
54
|
-
|
|
55
56
|
await initializeAgent(walletSecret)
|
|
56
57
|
} catch (err: unknown) {
|
|
57
58
|
const error = new BifoldError(
|
|
@@ -14,7 +14,6 @@ import { useAppAgent } from '../utils/agent'
|
|
|
14
14
|
import PINVerify, { PINEntryUsage } from './PINVerify'
|
|
15
15
|
import { SafeAreaView } from 'react-native-safe-area-context'
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
const ToggleBiometry: React.FC = () => {
|
|
19
18
|
const [store, dispatch] = useStore()
|
|
20
19
|
const { agent } = useAppAgent()
|
|
@@ -138,8 +137,8 @@ const ToggleBiometry: React.FC = () => {
|
|
|
138
137
|
animationType={'slide'}
|
|
139
138
|
presentationStyle={'fullScreen'}
|
|
140
139
|
>
|
|
141
|
-
<SafeAreaView edges={['top']} style={{ backgroundColor: NavigationTheme.colors.primary }}/>
|
|
142
|
-
<FauxHeader title={t('Screens.EnterPIN')} onBackPressed={onBackPressed}/>
|
|
140
|
+
<SafeAreaView edges={['top']} style={{ backgroundColor: NavigationTheme.colors.primary }} />
|
|
141
|
+
<FauxHeader title={t('Screens.EnterPIN')} onBackPressed={onBackPressed} />
|
|
143
142
|
<PINVerify
|
|
144
143
|
usage={PINEntryUsage.ChangeBiometrics}
|
|
145
144
|
setAuthenticated={onAuthenticationComplete}
|
package/src/services/keychain.ts
CHANGED
|
@@ -175,6 +175,9 @@ export const loadWalletSecret = async (title?: string, description?: string): Pr
|
|
|
175
175
|
return secret
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
// This function checks if the biometrics on a device have been configured
|
|
179
|
+
// If fingerprints or a face scan is setup, this will return true
|
|
180
|
+
// If the device supports biometrics but they have not been configured, it will return false
|
|
178
181
|
export const isBiometricsActive = async (): Promise<boolean> => {
|
|
179
182
|
const result = await getSupportedBiometryType()
|
|
180
183
|
return Boolean(result)
|
package/src/theme.ts
CHANGED
|
@@ -730,21 +730,21 @@ export interface ITabTheme {
|
|
|
730
730
|
shadowOpacity: number
|
|
731
731
|
borderTopWidth: number
|
|
732
732
|
paddingBottom: number
|
|
733
|
-
}
|
|
734
|
-
tabBarContainerStyle: ViewStyle
|
|
735
|
-
tabBarActiveTintColor: string
|
|
736
|
-
tabBarInactiveTintColor: string
|
|
733
|
+
}
|
|
734
|
+
tabBarContainerStyle: ViewStyle
|
|
735
|
+
tabBarActiveTintColor: string
|
|
736
|
+
tabBarInactiveTintColor: string
|
|
737
737
|
tabBarTextStyle: TextStyle & {
|
|
738
738
|
fontSize: number
|
|
739
|
-
}
|
|
739
|
+
}
|
|
740
740
|
tabBarButtonIconStyle: {
|
|
741
741
|
color: string
|
|
742
|
-
}
|
|
743
|
-
focusTabIconStyle: ViewStyle
|
|
742
|
+
}
|
|
743
|
+
focusTabIconStyle: ViewStyle
|
|
744
744
|
focusTabActiveTintColor: {
|
|
745
745
|
backgroundColor: string
|
|
746
|
-
}
|
|
747
|
-
tabBarSecondaryBackgroundColor: string
|
|
746
|
+
}
|
|
747
|
+
tabBarSecondaryBackgroundColor: string
|
|
748
748
|
}
|
|
749
749
|
|
|
750
750
|
export const TabTheme: ITabTheme = {
|