This commit is contained in:
James Cole
2018-06-23 17:59:37 +02:00
parent 3a71bd01fb
commit 793cfcb2c5
3 changed files with 6 additions and 1 deletions

View File

@@ -107,9 +107,10 @@ class ProfileController extends Controller
$domain = $this->getDomain(); $domain = $this->getDomain();
$secret = Google2FA::generateSecretKey(); $secret = Google2FA::generateSecretKey();
session()->flash('two-factor-secret', $secret); session()->flash('two-factor-secret', $secret);
$image = Google2FA::getQRCodeInline($domain, auth()->user()->email, $secret, 200); $image = Google2FA::getQRCodeInline($domain, auth()->user()->email, $secret, 200);
return view('profile.code', compact('image')); return view('profile.code', compact('image','secret'));
} }
/** /**

View File

@@ -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_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_reset_code' => 'Reset verification code',
'pref_two_factor_auth_disable_2fa' => 'Disable 2FA', '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', 'pref_save_settings' => 'Save settings',
'saved_preferences' => 'Preferences saved!', 'saved_preferences' => 'Preferences saved!',
'preferences_general' => 'General', 'preferences_general' => 'General',

View File

@@ -22,6 +22,9 @@
<img src="{{ image }}" alt="" title="" <img src="{{ image }}" alt="" title=""
style="border:1px #ddd solid;"/> style="border:1px #ddd solid;"/>
</div> </div>
<p>
{{ trans('firefly.2fa_use_secret_instead', {secret: secret}) }}
</p>
</div> </div>
</div> </div>
</div> </div>