This commit is contained in:
parent
dc86028777
commit
679d3f77d2
@ -77,9 +77,13 @@ class LoginController extends Controller
|
||||
*/
|
||||
protected function validateLogin(Request $request)
|
||||
{
|
||||
// 個別未入力メッセージ(仕様1,2)
|
||||
$request->validate([
|
||||
'ope_id' => 'required|string', // オペレータID(旧システムと同じ)
|
||||
'ope_pass' => 'required|string', // オペレータパスワード(旧システムと同じ)
|
||||
'ope_id' => 'required|string',
|
||||
'ope_pass' => 'required|string',
|
||||
], [
|
||||
'ope_id.required' => 'ログインIDが未入力です。',
|
||||
'ope_pass.required' => 'パスワードが未入力です。',
|
||||
]);
|
||||
}
|
||||
|
||||
@ -91,6 +95,13 @@ class LoginController extends Controller
|
||||
*/
|
||||
protected function attemptLogin(Request $request)
|
||||
{
|
||||
// 先にIDのみでオペレータ取得して退職フラグを確認(仕様5-1)
|
||||
$opeId = $request->input('ope_id');
|
||||
$operator = \App\Models\Ope::where('ope_id', $opeId)->first();
|
||||
if ($operator && (int)($operator->ope_quit_flag) === 1) {
|
||||
// 退職扱いは認証失敗と同じメッセージ(仕様5-1 と 3/4 統一表示)
|
||||
return false;
|
||||
}
|
||||
return Auth::attempt($this->credentials($request), false);
|
||||
}
|
||||
|
||||
@ -118,9 +129,9 @@ class LoginController extends Controller
|
||||
protected function sendLoginResponse(Request $request)
|
||||
{
|
||||
$request->session()->regenerate();
|
||||
|
||||
$this->clearLoginAttempts($request);
|
||||
|
||||
// 仕様5: ログインIDをセッション保持
|
||||
$request->session()->put('login_ope_id', $request->input('ope_id'));
|
||||
return redirect()->intended($this->redirectTo);
|
||||
}
|
||||
|
||||
|
||||
@ -12,6 +12,6 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'failed' => '認証情報と一致するレコードがありません。',
|
||||
'failed' => 'ログインID・パスワードが不正です。',
|
||||
'throttle' => 'ログインの試行回数が多すぎます。:seconds 秒後にお試しください。',
|
||||
];
|
||||
|
||||
@ -11,12 +11,12 @@
|
||||
<p class="login-box-msg">{{ __('ログインID、パスワードを入力して') }}<br
|
||||
class="d-none d-lg-inline">{{ __('ログインボタンをクリックしてください') }}</p>
|
||||
|
||||
<form action="{{ route('login') }}" method="post">
|
||||
<form action="{{ route('login') }}" method="post" novalidate>
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||
<div class="input-group mb-3 {{ $errors->has('ope_id') ? 'error_input' : '' }}">
|
||||
<input type="text"
|
||||
class="form-control form-control-lg"
|
||||
placeholder="{{ __('ログインID') }}" name="ope_id" value="{{ old('ope_id') }}" required>
|
||||
placeholder="{{ __('ログインID') }}" name="ope_id" value="{{ old('ope_id') }}">
|
||||
<div class="input-group-append">
|
||||
<span class="fa fa-user input-group-text"></span>
|
||||
</div>
|
||||
@ -29,7 +29,7 @@
|
||||
<div class="input-group mb-3 {{ $errors->has('ope_pass') ? 'error_input' : '' }}">
|
||||
<input type="password"
|
||||
class="form-control form-control-lg "
|
||||
placeholder="{{ __('パスワード') }}" name="ope_pass" required>
|
||||
placeholder="{{ __('パスワード') }}" name="ope_pass">
|
||||
<div class="input-group-append">
|
||||
<span class="fa fa-lock input-group-text"></span>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user