SwiftPasscodeLock icon indicating copy to clipboard operation
SwiftPasscodeLock copied to clipboard

Biometrics authentication presented even if !hasPasscode

Open jovan90jovanovic opened this issue 9 years ago • 4 comments

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()
    }
}

jovan90jovanovic avatar Feb 25 '16 13:02 jovan90jovanovic

Trying this workaround. I'm also having the same issue in the same scenario you describe above.

jaytrixz avatar Mar 09 '16 03:03 jaytrixz

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 avatar Mar 12 '16 12:03 ziogaschr

@ziogaschr Thanks for fixing. Nice framework indeed.

jovan90jovanovic avatar Mar 13 '16 23:03 jovan90jovanovic

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.

tovfigh avatar Aug 09 '16 14:08 tovfigh