Skip to content

Commit

Permalink
feat: allow toggle to use fallback always
Browse files Browse the repository at this point in the history
Signed-off-by: Berend Sliedrecht <[email protected]>
  • Loading branch information
berendsliedrecht committed Nov 20, 2024
1 parent 06914a8 commit df02a7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/SecureEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,9 @@ export const getSecureEnvironment = () => {
return fallbackSecureEnvironment
}

export const shouldUseFallbackSecureEnvironment = (useFallback: boolean) => {
isExpoSecureEnvironmentSupported = !useFallback
}

export const isLocalSecureEnvironmentSupported = () =>
Platform.OS === 'ios' ? true : expoSecureEnvironment.supportsSecureEnvironment()
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { SubjectPublicKeyInfo } from '@peculiar/asn1-x509'
import { Platform } from 'expo-modules-core'
import { getSecureEnvironment } from './SecureEnvironment'

export { SecureEnvironment, setFallbackSecureEnvironment, isLocalSecureEnvironmentSupported } from './SecureEnvironment'
export {
SecureEnvironment,
setFallbackSecureEnvironment,
isLocalSecureEnvironmentSupported,
shouldUseFallbackSecureEnvironment,
} from './SecureEnvironment'

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

0 comments on commit df02a7b

Please sign in to comment.