SwiftPasscodeLock
SwiftPasscodeLock copied to clipboard
Biometrics authentication presented even if !hasPasscode
Scenario: When user logs in and set the passcode, then logs out and app deletes the passcode from defaults, if user closes and opens the app, biometrics authentication is presented. It can be canceled and user can continue using the app.
Fixable by:
private func authenticateWithBiometrics() {
if !self.passcodeConfiguration.repository.hasPasscode { return }
if passcodeConfiguration.shouldRequestTouchIDImmediately && passcodeLock.isTouchIDAllowed {
passcodeLock.authenticateWithBiometrics()
}
}
Trying this workaround. I'm also having the same issue in the same scenario you describe above.
Nice catch @jovan90jovanovic.
I have fixed @velikanov's fork, which I hope to be merged soon with @yankodimitrov one, so as we can contribute to a single place, for this nice framework.
@ziogaschr Thanks for fixing. Nice framework indeed.
Hi, I have the same problem.
When I turn passcode off, clearEvents() is called and UIApplicationWillEnterForegroundNotification observer is removed, but for some reason when I close the app and open it again, appWillEnterForegroundHandler() is called even with the observer removed and so then authenticateWithBiometrics().
@jovan90jovanovic workaround fix biometrics authentication alertView but I think the real problem is still there.
Just wanted to add this if its in some way usefull.