From 870d8b5008abfaf6e4d45d5195490420d1ce4b47 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 3 May 2017 21:12:49 +0200 Subject: [PATCH] No prefix key, issue #624 --- app/Http/Controllers/PreferencesController.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index 0a200b4a47..7ef95c1307 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -56,12 +56,8 @@ class PreferencesController extends Controller */ public function code(Google2FA $google2fa) { - $domain = $this->getDomain(); - $secretKey = 'FIREFLYIII'; - $secretKey = str_pad($secretKey, intval(pow(2, ceil(log(strlen($secretKey), 2)))), 'X'); - - /** @noinspection PhpMethodParametersCountMismatchInspection */ - $secret = $google2fa->generateSecretKey(16, $secretKey); + $domain = $this->getDomain(); + $secret = $google2fa->generateSecretKey(16); Session::flash('two-factor-secret', $secret); $image = $google2fa->getQRCodeInline('Firefly III at ' . $domain, auth()->user()->email, $secret, 150);