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 6caf007
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 shouldUFallbackSecureEnvironment = (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,
shouldUFallbackSecureEnvironment,
} from './SecureEnvironment'

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

0 comments on commit 6caf007

Please sign in to comment.