0

I have the following HTML inside of my view. It's using a boostrap modal. It works fine for logging-in and redirecting, but upon a failed login attempt it's not redirecting the user back to te actual login page. action="{{ route('login') }}"> shouldn't this be taking the user back to the login page?

<form class="form-horizontal" method="POST" action="{{ route('login') }}">
                                    {{ csrf_field() }}

                                    <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
                                        <div class="col-md-12">
                                            <input id="email" type="email" placeholder = "Email address.." class="form-control" name="email" value="{{ old('email') }}" required autofocus>
                                        </div>
                                    </div>


                                    <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
                                        <div class="col-md-12">
                                            <input id="password" type="password" placeholder = "Password" class="form-control" name="password" required>
                                        </div>
                                    </div>
                                </div>

                                <p class = "small" style="padding:10px;">By signing up, you are indicating that you have read and agree to the <a href="">Terms of Use</a> and <a href="#">Privacy Policy</a>.</p>

                                <div class="modal-footer">
                                    <button type="submit" class="btn btn-primary">Enter</button>
                                </div>

                                </form>
tonyh
  • 17
  • 6

1 Answers1

0

The actual redirecting problem might be caused by the called controller. Please check the function/method behind the post login and check if you have sth. like

return Redirect::back()->withErrors(['msg', 'The Message']);

at the end of the validation.

Here you can find a related post about redirecting.

For further informations about redirecting have a look at the documentation. There are also pretty good examples about the redirect function with parameters

Spears
  • 2,102
  • 1
  • 17
  • 27