cretueusebiu / laravel-spark-google2fa

Google Authenticator support for Laravel Spark
https://packagist.org/packages/eusebiu/laravel-spark-google2fa
MIT License
87 stars 25 forks source link

Invalid Barcode caused by spaces in $details['vendor'] #7

Closed securit closed 8 years ago

securit commented 8 years ago

Hi,

You need to make your getQrUrl function URL safe by encoding it as spaces or safe characters in the $details['vendor'] string can cause the QR code generation to fail.

Modify line 53 of TwoFactorAuthController to URLencode the vendor details as follows:

$company = isset(Engagement::$details['vendor']) ? urlencode(Engagement::$details['vendor']) : url()->to('/');

That will resolve this bug

cretueusebiu commented 8 years ago

Fixed https://github.com/cretueusebiu/laravel-spark-google2fa/commit/e5bd639a1e61e72ae22965acd92644157f276a7b