Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Code for #3180
James Cole774f7d88c2f4
diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.phpindex 28dbae7aef..3f0ea68425 100644--- a/app/Http/Controllers/Auth/TwoFactorController.php+++ b/app/Http/Controllers/Auth/TwoFactorController.php@@ -34,6 +34,20 @@ use Preferences;*/class TwoFactorController extends Controller{+ /**+ * What to do if 2FA lost?+ *+ * @return mixed+ */+ public function lostTwoFactor()+ {+ /** @var User $user */+ $user = auth()->user();+ $siteOwner = config('firefly.site_owner');+ $title = (string)trans('firefly.two_factor_forgot_title');+ return view('auth.lost-two-factor', compact('user', 'siteOwner', 'title'));+ }+/*** @param Request $request*@@ -118,27 +132,6 @@ class TwoFactorController extends ControllerPreferences::set('mfa_history', $newHistory);}- /**- * What to do if 2FA lost?- *- * @return mixed- */- public function lostTwoFactor()- {- /** @var User $user */- $user = auth()->user();- $siteOwner = config('firefly.site_owner');- $title = (string)trans('firefly.two_factor_forgot_title');-- Log::info(- 'To reset the two factor authentication for user #' . $user->id .- ' (' . $user->email . '), simply open the "preferences" table and delete the entries with the names "twoFactorAuthEnabled" and' .- ' "twoFactorAuthSecret" for user_id ' . $user->id . '. That will take care of it.'- );-- return view('auth.lost-two-factor', compact('user', 'siteOwner', 'title'));- }-/*** Each MFA history has a timestamp and a code, saving the MFA entries for 5 minutes. So if the* submitted MFA code has been submitted in the last 5 minutes, it won't work despite being valid.diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.phpindex 52261e74c4..f4b0edf0e3 100644--- a/resources/lang/en_US/firefly.php+++ b/resources/lang/en_US/firefly.php@@ -95,7 +95,7 @@ return ['two_factor_forgot' => 'I forgot my two-factor thing.','two_factor_lost_header' => 'Lost your two factor authentication?','two_factor_lost_intro' => 'If you lost your backup codes as well, you have bad luck. This is not something you can fix from the web interface. You have two choices.',- 'two_factor_lost_fix_self' => 'If you run your own instance of Firefly III, check the logs in <code>storage/logs</code> for instructions, or run <code>docker logs <container_id></code> to see the instructions (refresh this page).',+ 'two_factor_lost_fix_self' => 'If you run your own instance of Firefly III, read <a href="https://docs.firefly-iii.org/faq/other#i-lost-my-two-factor-authentication-codes-and-backup-codes">this entry in the FAQ</a> for instructions.','two_factor_lost_fix_owner' => 'Otherwise, email the site owner, <a href="mailto::site_owner">:site_owner</a> and ask them to reset your two factor authentication.','mfa_backup_code' => 'You have used a backup code to login to Firefly III. It can\'t be used again, so cross it from your list.','pref_two_factor_new_backup_codes' => 'Get new backup codes',