google2fa-qrcode icon indicating copy to clipboard operation
google2fa-qrcode copied to clipboard

getting this error

Open subtain-haider opened this issue 2 years ago • 3 comments

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

subtain-haider avatar Mar 03 '22 00:03 subtain-haider

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 avatar Mar 10 '22 10:03 Commifreak

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!

Commifreak avatar Mar 10 '22 11:03 Commifreak

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!

marcellopato avatar Nov 21 '23 21:11 marcellopato