"README.rst" did not exist on "99e42d9be32f887e8889c9df42ce97269f105fcf"
Newer
Older
<v-container fill-height>
<v-layout align-center justify-center>

robinwilliam.hundt
committed
<v-flex text-xs-center xs8 sm6 md4 lg2>
<img src="../assets/brand.png"/>
<h3 class="pt-3">Log in</h3>

robinwilliam.hundt
committed
v-if="msg"
color="error"
:value="true"
transition="fade-transition"

robinwilliam.hundt
committed
>{{ msg }}</v-alert>
<p v-else>But I corrected them, sir.</p>
<v-form
@submit.prevent="submit">
<v-text-field
label="Username"
v-model="credentials.username"
<v-text-field
label="Password"
v-model="credentials.password"
type="password"
<v-btn :loading="loading" type="submit" color="primary">Access</v-btn>
</v-form>
</v-flex>
</v-layout>
</v-container>
</template>
<script>
import {mapActions, mapState} from 'vuex'
export default {
name: 'grady-login',
data () {
return {
credentials: {
username: '',
password: ''
},

robinwilliam.hundt
committed
...mapState({
msg: state => state.authentication.message,
userRole: state => state.authentication.userRole
})
...mapActions([

robinwilliam.hundt
committed
'getJWT',
'getUserRole',
'getJWTTimeDelta'

robinwilliam.hundt
committed
this.getJWT(this.credentials).then(() => {
this.getUserRole().then(() => {
this.$router.push({name: 'home'})
this.loading = false
}).catch(() => { this.loading = false })
}
}
}
</script>
<style scoped>
</style>