0

What I have: Im developing in Laravel 5.3 and calling an API with vue.js. The workaround is I submit the form with vue.js, make a call to the API and returned a token if all ok.

Problem: Google Chrome dont remember my login credentials after an sucessfull login (Edge, Firefox and Safari yes).

What I try: Like I have seen in other questions in StackOverflow (Mostly here), I have put a name attribute to the tags (Even if I use email instead of username). Don't use prevent of vue.js. Do all the login and finish with an .submit(); No one works in Chrome.

My code:

<form id="loginForm" class="form-horizontal m-t-20" v-on:submit.prevent="login" action="{{secure_url('/')}}" autocomplete="on">
    <div class="form-group">
        <div class="error col-xs-12"></div>
    </div>
    <div class="form-group ">
        <div class="col-xs-12">
            <input name="username" class="form-control" v-model="email" type="text" required="" placeholder="{{Lang::get('general.email')}}">
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-12">
            <input class="form-control" name="password" v-model="password" type="password" required="" placeholder="{{Lang::get('general.password')}}">
        </div>
    </div>
    <div class="form-group text-center m-t-40">
        <div class="col-xs-12">
            <button class="btn btn-primary btn-block text-uppercase waves-effect waves-light" type="submit">{{Lang::get('general.logIn')}}</button>
        </div>
    </div>

</form>

Thanks for your time and help.

Community
  • 1
  • 1
Itipacs
  • 182
  • 7

1 Answers1

1

That means that you probably missing either field name or field ID

To be sure that it will work in all browsers be sure to provide both, even if name should be enough.

If your code is correct, make sure that you initialize your v-model variables.

Also, you should not use form while using Vue as you do not need input data bundled into the form as Vue model is handling that.

Marek Urbanowicz
  • 12,659
  • 16
  • 62
  • 87