Re-use login string

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-06-20 15:32:00 +01:00
parent 114769c2d9
commit e11a42cf68
2 changed files with 2 additions and 3 deletions

View file

@ -428,7 +428,7 @@ class LoginController extends Controller
} }
if (! $request->has('two_factor_secret')) { // TODO this seems almost the same as above? if (! $request->has('two_factor_secret')) { // TODO this seems almost the same as above?
return redirect()->route('two-factor')->with('error', 'Two-factor code is required.'); return redirect()->route('two-factor')->with('error', trans('auth/message.two_factor.code_required'));
} }
$user = Auth::user(); $user = Auth::user();
@ -439,7 +439,7 @@ class LoginController extends Controller
$user->saveQuietly(); $user->saveQuietly();
$request->session()->put('2fa_authed', $user->id); $request->session()->put('2fa_authed', $user->id);
return redirect()->route('home')->with('success', trans('auth/general.login_success')); return redirect()->route('home')->with('success', trans('auth/message.signin.success'));
} }
return redirect()->route('two-factor')->with('error', trans('auth/message.two_factor.invalid_code')); return redirect()->route('two-factor')->with('error', trans('auth/message.two_factor.invalid_code'));

View file

@ -15,6 +15,5 @@ return [
'google_login' => 'Login with Google Workspace', 'google_login' => 'Login with Google Workspace',
'google_login_failed' => 'Google Login failed, please try again.', 'google_login_failed' => 'Google Login failed, please try again.',
'two_factor_code' => 'Please enter your two-factor authentication code.', 'two_factor_code' => 'Please enter your two-factor authentication code.',
'login_success' => 'You are logged in!.',
]; ];