Skip to content
Snippets Groups Projects

Upgrade to vuetify1.0 / login error message

Merged robinwilliam.hundt requested to merge 59-login-failure-message into master
4 files
+ 46
23
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -4,20 +4,30 @@
@@ -4,20 +4,30 @@
<v-flex text-xs-center md4 lg2>
<v-flex text-xs-center md4 lg2>
<img src="../assets/brand.png"/>
<img src="../assets/brand.png"/>
<h3 class="pt-3">Log in</h3>
<h3 class="pt-3">Log in</h3>
<p>But I corrected them, sir.</p>
<v-alert
outline
<v-form>
v-if="error"
 
color="error"
 
:value="true"
 
transition="fade-transition"
 
>{{ error }}</v-alert>
 
<p v-else>But I corrected them, sir.</p>
 
<v-form
 
@submit="submit">
<v-text-field
<v-text-field
label="Username"
label="Username"
v-model="credentials.username"
v-model="credentials.username"
required></v-text-field>
required
 
autofocus
 
></v-text-field>
<v-text-field
<v-text-field
label="Password"
label="Password"
v-model="credentials.password"
v-model="credentials.password"
type="password"
type="password"
required></v-text-field>
required
 
></v-text-field>
 
<v-btn type="submit" color="primary">Access</v-btn>
</v-form>
</v-form>
<v-btn color="primary" @click="submit()">Access</v-btn>
</v-flex>
</v-flex>
</v-layout>
</v-layout>
</v-container>
</v-container>
@@ -38,12 +48,10 @@
@@ -38,12 +48,10 @@
},
},
methods: {
methods: {
submit () {
submit () {
const credentials = {
this.$store.dispatch('getJWTToken', this.credentials).then(response => {
username: this.credentials.username,
password: this.credentials.password
}
this.$store.dispatch('getToken', credentials).then(response => {
this.$router.push('/reviewer/')
this.$router.push('/reviewer/')
 
}).catch(_ => {
 
this.error = this.$store.state.error
})
})
}
}
}
}
Loading