Skip to content

Commit

Permalink
Show error if email or password is not valid
Browse files Browse the repository at this point in the history
  • Loading branch information
ziishaned committed Apr 12, 2017
1 parent 78cbd81 commit a184f9b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 2 additions & 3 deletions app/Http/Controllers/TeamController.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ public function postLogin()
]);
}

return redirect()->back()->with([
'alert' => 'Email or password is not valid.',
'alert_type' => 'danger',
return redirect()->back()->withErrors([
'wrong_credential' => 'Email or password is not valid.'
]);
}

Expand Down
8 changes: 7 additions & 1 deletion resources/views/team/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
<div class="home-page login-page">
<div class="login-form-con" style="margin-bottom: 24px;">
<h1 class="header text-center" style="font-size: 28px;">Login</h1>
<form action="{{ route('team.postlogin') }}" method="POST" role="form">
@if($errors->has('wrong_credential'))
<div class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{{ $errors->first('wrong_credential') }}
</div>
@endif
<form action="{{ route('team.postlogin') }}" method="POST" role="form">
<div class="form-group {{ $errors->has('team_name') ? 'has-error' : '' }}">
<label for="team-name" class="control-label">Team Name</label>
<input type="text" name="team_name" class="form-control" id="team-name" autocomplete="on" required>
Expand Down

0 comments on commit a184f9b

Please sign in to comment.