jeudi 28 janvier 2016

How to stop bootstrap modal from closing after authentication fail in laravel 5.1?

I have a bootstrap modal for login but when ever it fails it redirects to auth/login and the modal closes. So how would I stop the modal from closing when the authentication fails and how will I stop it from redirecting back to auth/login?

My login form:

<form action="{{ URL::to('auth/login')}}" method="POST">

{!! csrf_field() !!}

<div class="left-form__form">
    <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
        <input class="mdl-textfield__input" type="text" id="mdl_email" name="email">
        <label class="mdl-textfield__label" for="mdl_email">Email ID</label>
    </div>
    <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
        <input class="mdl-textfield__input" type="password" id="mdl_password" name="password">
        <label class="mdl-textfield__label" for="mdl_password">Password</label>
    </div>
    <div class="left-form__form--bottom">
        <button type="submit" class="btn-style1 mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--accent">
            login
        </button>
        <a href="javascript:void(0);" class="fgt-pwd">forgot password?</a>
    </div>
    <a href="#" class="register-link">New to srsgrocery? <span>SIGNUP</span></a>
</div>
</form>

The modal :

@if(Auth::guest())
    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 top-right">
        <span class="call-icon"></span>
        <span class="call-text">Call to Order: 1800-419-2777</span>
        <a href="" title="" class="login" data-toggle="modal" data-target="#loginRegisterModal">Login |</a>
        <a href="" title="" class="register" data-toggle="modal" data-target="#loginRegisterModal">Register</a>
    </div>
    @else
    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 top-right">
        <span class="call-icon"></span>
        <span class="call-text">Call to Order: 1800-419-2777</span>
        <a href="{{URL::to('myaccount')}}">My Account </a>                        
        <a href="{{URL::to('auth/logout')}}">Logout</a>
    </div>
@endif



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire