tiuub / KeeOtp2

KeeOtp2 is a plugin for KeePass. It provides a form to display one time passwords and is fully compatible with the built-in OTP function.
MIT License
126 stars 11 forks source link

QR Code Scanning not working #40

Closed Tendodeku closed 2 years ago

Tendodeku commented 2 years ago

When I try to scan a QR code on the screen, I get this error. I'm on Windows 10

image

meandthemachine commented 2 years ago

@Neverforgetit08 Which version of the plugin? Are you using two or more screens? ... maybe this is a duplicate of #37 which has been fixed in version 1.5.8.1.

Tendodeku commented 2 years ago

@meandthemachine I'm using the latest version, version 1.5.8.1. It does scan sometimes, but most of the time, I get the error above. I'd say it works like 40% of the time. I'm also using one screen.

tiuub commented 2 years ago

Hey @Neverforgetit08,

I have to apologize, for answering that late. Currently I'm stressed out due to my exams.

I've planned to release an update soon after my exams. I hope that I can release it about the end of next week. I would appreciate it, if you can provide further information to your issue. So I'm able to reproduce your issue.

Kind regards

Tendodeku commented 2 years ago

@tiuub Its fine, you don't have to apologize. Please focus on your exams as that is more important. I will go through all the sites I have 2fa enabled and provide more information.

Tendodeku commented 2 years ago

I tried scanning 2fa QR codes from different sites, and I found out that if I keep hitting "retry" on the prompt above, it'll eventually scan the QR code. I suppose it's not that it doesn't work, it's just inconsistent.

I tried it several times, and I noticed the following outcomes, 1 being the most common outcome:

  1. It doesn't work no matter how much I hit retry
  2. It works after hitting retry for as much as 30 times
  3. It works immediately or after ~2 tries.

Google seems to be the most inconsistent from my test. I also tried to zoom in the web-page to increase the size of the qr code, but it didn't seem to make any significant change

meandthemachine commented 2 years ago

I can reproduce and observe it as well in 1.5.8.1. It seems to almost happen everytime if either the initial message box or the "retry" message box (shown in @Tendodeku 's screenshot) covers parts of the QR code (which is quite likely since those message boxes seem to be shown centered on the screen and so often are the QR codes in the browser). Maybe the plugin's windows don't hide fast enough (which under the hood might be done asynchronously via Windows messages, I assume) or the screenshots are taken too early, respectively.

In the past, I always inituitively moved the QR code to the other screen before scanning. That's why I found #37 but never encountered this one (or at least I can't remember).

@tiuub I'm now shutting up on this, as I don't want to distract you any further : ) Good luck for your exams!

tiuub commented 2 years ago

Hey, finally I've fixed this issue. So I added delay while taking the screenshot, so the window is now completely invisible while taking the screenshot.

Kind regards tiuub

Tendodeku commented 2 years ago

Thank you😊. Keep up the good work😁