RobThree / TwoFactorAuth

PHP library for Two Factor Authentication (TFA / 2FA)
MIT License
1.08k stars 128 forks source link

Incompatible with endroid/qr-code > 5.0.0 #114

Closed Mattie112 closed 11 months ago

Mattie112 commented 12 months ago

When using this project with endroid/qr-code version 5.0.2 I get the following error:

Exception {"message":"Class \"Endroid\\QrCode\\ErrorCorrectionLevel\\ErrorCorrectionLevelHigh\" not found"} 
            $qr_provider = new EndroidQrCodeProvider();
            $tfa = new TwoFactorAuth(issuer: "xx", qrcodeprovider: $qr_provider);
            $qr = $tfa->getQRCodeImageAsDataUri("uid", $secret);

With version 4.8.5 it works just fine.

willpower232 commented 12 months ago

I guess this line doesn't work for version 5 then?

https://github.com/RobThree/TwoFactorAuth/blob/137df4dd3cd998e7096705cd0b3aed17b4c25d53/lib/Providers/Qr/EndroidQrCodeProvider.php#L31

Definitely open to PRs on this one.

Mattie112 commented 12 months ago

I will try to see if that is the only problem and then create a PR for this! if it is more work I dont have time right now and I will report back.

Mattie112 commented 12 months ago

This should fix it: https://github.com/RobThree/TwoFactorAuth/pull/115

Don't currently have the time to test it with other versions then 4 and 5.

willpower232 commented 11 months ago

@Mattie112 thanks for the PR and the patience for me to sort it out, feel free to close if everything is working as intended for you now

Mattie112 commented 11 months ago

Thanks, I will update to the latest version and confirm that it works. Thans for adding the test/build config, did not notice that :)

Mattie112 commented 11 months ago

Yes, all seem to be working fine (with Endroid v5).

Great timing btw, I was just about to merge my internal MR but now I can set it back to this repo instead of my own fork :)

Thanks again!