Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the logic of allowableReuseDuration property #38

Closed
lmvdev opened this issue Sep 8, 2020 · 9 comments
Closed

Changing the logic of allowableReuseDuration property #38

lmvdev opened this issue Sep 8, 2020 · 9 comments

Comments

@lmvdev
Copy link

lmvdev commented Sep 8, 2020

There are 2 issues when using allowableReuseDuration:

  • value 0 is not equal to disabling the property;
  • only one instance of LAContext is uses.

It can get trouble for example in situation when I set allowableReuseDuration and start scanning a lot of times - each next scanning will use the first result.

Could you change the logic of allowableReuseDuration?

  • remove optional type (from TimeInterval? to TimeInterval);
  • add the default value 0 to allowableReuseDuration;
  • remove didSet handler from allowableReuseDuration;
  • set the touchIDAuthenticationAllowableReuseDuration property right after LAContext creation.

For example

var allowableReuseDuration: TimeInterval = 0

// context
let context = LAContext()
context.touchIDAuthenticationAllowableReuseDuration = allowableReuseDuration
@rushisangani
Copy link
Owner

@lmvdev thanks for the feedback.
I'm not getting regarding set the allowableReuseDuration and start scanning a lot of times.
As per the documentation, this is only useful when the user has just unlocked the device with faceId or touchId and in the app we want to authenticate again.

Refer this for more details.
https://developer.apple.com/documentation/localauthentication/lacontext/1622329-touchidauthenticationallowablere

Please let me know your inputs :)

Thanks

@lmvdev
Copy link
Author

lmvdev commented Oct 1, 2020

I made the test project for you :)
Please, make follow steps:

  1. configure face id on your device
  2. install the application, not launch
  3. lock the device and unlock with passcode (without your biometry)
  4. launch the application and tap "Login" button
  5. use your biometry to unlock the authorized part of application
  6. move to the authorized screen (green background)
  7. tap the "Logout" button and move to the unauthorized screen
  8. tap the "Login" button <---- HERE you don't have to use your biometry, you can moving between authorized and unauthorized parts as much as you want

I think the last step is not correct because you unlocked the device without biometry (as I wrote in 3 step).
The reason of such behaviour I wrote in the first message of current issue.
Could you change the logic of allowableReuseDuration?

BiometricAuthenticationTest.zip

@rushisangani rushisangani pinned this issue Oct 4, 2020
@lmvdev
Copy link
Author

lmvdev commented Oct 13, 2020

Hello
Is there news? Did you reproduce the problem?

@rushisangani
Copy link
Owner

@lmvdev I have checked your solution and you're right.
In the last step it should not use the previous value for authentication.
I much your appreciate your efforts to come up with this issue.

This can be solved in two ways:

  1. Since you know the solution, Create a PR and be a collaborator
  2. I will fix it and release the update later.

Let me know your thoughts :)

Thanks again
Rushi

@lmvdev
Copy link
Author

lmvdev commented Oct 13, 2020

You can fix )
How long does it take?

@rushisangani
Copy link
Owner

I will update to you soon.

@rushisangani
Copy link
Owner

@lmvdev this is fixed in the new version v3.1.3
Note: platform :ios, '12.0' is required while installing the pod.

@lmvdev
Copy link
Author

lmvdev commented Oct 14, 2020

Thank you!
I will check it later.
Why did you change minimum iOS version in pods?

@rushisangani
Copy link
Owner

It was Xcode12 standard recommendation. I also thought it's better to remove support for way older versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants