Skip to content

Commit 2532b32

Browse files
Berend Sliedrechtberendsliedrecht
Berend Sliedrecht
authored andcommitted
feat: allow toggle to use fallback always
Signed-off-by: Berend Sliedrecht <[email protected]>
1 parent 06914a8 commit 2532b32

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/SecureEnvironment.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,9 @@ export const getSecureEnvironment = () => {
4141
return fallbackSecureEnvironment
4242
}
4343

44+
export const shouldUseFallbackSecureEnvironment = (useFallback: boolean) => {
45+
isExpoSecureEnvironmentSupported = !useFallback
46+
}
47+
4448
export const isLocalSecureEnvironmentSupported = () =>
4549
Platform.OS === 'ios' ? true : expoSecureEnvironment.supportsSecureEnvironment()

src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import { SubjectPublicKeyInfo } from '@peculiar/asn1-x509'
44
import { Platform } from 'expo-modules-core'
55
import { getSecureEnvironment } from './SecureEnvironment'
66

7-
export { SecureEnvironment, setFallbackSecureEnvironment, isLocalSecureEnvironmentSupported } from './SecureEnvironment'
7+
export {
8+
SecureEnvironment,
9+
setFallbackSecureEnvironment,
10+
isLocalSecureEnvironmentSupported,
11+
shouldUseFallbackSecureEnvironment,
12+
} from './SecureEnvironment'
813

914
export async function generateKeypair(id: string, biometricsBacked = true): Promise<void> {
1015
await getSecureEnvironment().generateKeypair(id, biometricsBacked)

0 commit comments

Comments
 (0)