antonioribeiro / google2fa-qrcode

QRCode for Google2FA
MIT License
106 stars 25 forks source link

getting this error #22

Open subtain-haider opened 2 years ago

subtain-haider commented 2 years ago

here is my controller function

`public function settings() { $user = Auth::user(); $google2fa_url = ""; $secret_key = "";

    if($user->loginSecurity()->exists()){
        $google2fa = (new \PragmaRX\Google2FAQRCode\Google2FA());
        $google2fa_url = $google2fa->getQRCodeInline(
            'KB CRYPTO',
            $user->email,
            $user->loginSecurity->google2fa_secret
        );
        $secret_key = $user->loginSecurity->google2fa_secret;
    }

    $data = array(
        'user' => $user,
        'secret' => $secret_key,
        'google2fa_url' => $google2fa_url
    );

    return view('customer.settings', compact('user'))->with('data', $data);
}`

Screenshot

Commifreak commented 2 years ago

I have the same issue:

use PragmaRX\Google2FAQRCode\Google2FA;
$twoFa = new Google2FA();
$key = $twoFa->generateSecretKey();
$qrCode = $twoFa->getQRCodeInline("example", "example", $key);

message: You need to install a service package or assign yourself the service to be used.

Commifreak commented 2 years ago

Solved by installing one of the service package, as stated in the README:

Beginning on version 2.0 the rendering service is optional, so you have to manually install one of those packages in order to generate QRCodes

=> composer require bacon/bacon-qr-code

And BOOM!

marcellopato commented 10 months ago

Solved by installing one of the service package, as stated in the README:

Beginning on version 2.0 the rendering service is optional, so you have to manually install one of those packages in order to generate QRCodes

=> composer require bacon/bacon-qr-code

And BOOM!

This warning should e writing in BIGGER FONTS, LOL!