Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Code for #1503
James Cole793cfcb2c508
diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.phpindex 581f88b35d..c872ad7805 100644--- a/app/Http/Controllers/ProfileController.php+++ b/app/Http/Controllers/ProfileController.php@@ -107,9 +107,10 @@ class ProfileController extends Controller$domain = $this->getDomain();$secret = Google2FA::generateSecretKey();session()->flash('two-factor-secret', $secret);+$image = Google2FA::getQRCodeInline($domain, auth()->user()->email, $secret, 200);- return view('profile.code', compact('image'));+ return view('profile.code', compact('image','secret'));}/**diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.phpindex 48ad084831..bb282f79bc 100644--- a/resources/lang/en_US/firefly.php+++ b/resources/lang/en_US/firefly.php@@ -465,6 +465,7 @@ return ['pref_two_factor_auth_code_help' => 'Scan the QR code with an application on your phone such as Authy or Google Authenticator and enter the generated code.','pref_two_factor_auth_reset_code' => 'Reset verification code','pref_two_factor_auth_disable_2fa' => 'Disable 2FA',+ '2fa_use_secret_instead' => 'If you cannot scan the QR code, feel free to use the secret instead: :secret.','pref_save_settings' => 'Save settings','saved_preferences' => 'Preferences saved!','preferences_general' => 'General',diff --git a/resources/views/profile/code.twig b/resources/views/profile/code.twigindex 1313697c72..a1288322bd 100644--- a/resources/views/profile/code.twig+++ b/resources/views/profile/code.twig@@ -22,6 +22,9 @@<img src="{{ image }}" alt="" title=""style="border:1px #ddd solid;"/></div>+ <p>+ {{ trans('firefly.2fa_use_secret_instead', {secret: secret}) }}+ </p></div></div></div>