feat: soft biometrics lock (#1793)
This commit is contained in:
@@ -51,6 +51,7 @@ import {
|
||||
SubscriptionManager,
|
||||
WorkspaceClientInterface,
|
||||
WorkspaceManager,
|
||||
ChallengePrompt,
|
||||
} from '@standardnotes/services'
|
||||
import { FilesClientInterface } from '@standardnotes/files'
|
||||
import { ComputePrivateUsername } from '@standardnotes/encryption'
|
||||
@@ -929,6 +930,24 @@ export class SNApplication
|
||||
return this.deinit(this.getDeinitMode(), DeinitSource.Lock)
|
||||
}
|
||||
|
||||
public softLockBiometrics(): void {
|
||||
const challenge = new Challenge(
|
||||
[new ChallengePrompt(ChallengeValidation.Biometric)],
|
||||
ChallengeReason.ApplicationUnlock,
|
||||
false,
|
||||
)
|
||||
|
||||
void this.promptForCustomChallenge(challenge)
|
||||
|
||||
void this.notifyEvent(ApplicationEvent.BiometricsSoftLockEngaged)
|
||||
|
||||
this.addChallengeObserver(challenge, {
|
||||
onComplete: () => {
|
||||
void this.notifyEvent(ApplicationEvent.BiometricsSoftLockDisengaged)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
isNativeMobileWeb() {
|
||||
return this.environment === Environment.NativeMobileWeb
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user