<template>
     <form class="form-horizontal" role="form"  @submit.prevent="login">
                          <div class="form-group">
                                <label for="username" class="col-md-4 control-label">Username</label>

                                <div class="col-md-6">
                                    <input id="username" type="text" class="form-control" name="username" v-model="fields.username" required autofocus>
                                    <div v-if="errors && errors.username" class="text-danger">{{ errors.username[0] }}</div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="password" class="col-md-4 control-label">Password</label>

                                <div class="col-md-6">
                                    <input id="password" type="password" class="form-control" name="password" v-model="fields.password" required>
                                     <div v-if="errors && errors.password" class="text-danger">{{ errors.password[0] }}</div>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-md-6 col-md-offset-4">
                                    <button type="submit" class="btn btn-primary">
                                        Login          
                                    </button>
                                    &nbsp;&nbsp;
                                  <a href="/password/reset?user_type=admins">Forgot Password?</a>
                                      <input id="username" type="hidden" class="form-control" name="login" v-model="fields.login" required autofocus>
                                      <div v-if="errors && errors.login" class="text-danger">{{ errors.login[0] }}</div>
                               
                                </div>
                            </div>
                        </form>
</template>
<script>
import LoginMixin from '../shared/LoginMixin';
export default {
  mixins: [ LoginMixin ],

  data(){
    return{
      action: '/bmp/admin/submitlogin',
      fields:{
        username:this.a,
        password:this.b
      }
    }
  },
  mounted(){
            this.fields.password=document.getElementById('password').value;
            this.fields.username==document.getElementById('username').value;
            this.a=this.fields.username;
            this.b=this.fields.password;            
        }
}


</script>