Add basic login and register functionality

This commit is contained in:
Kevin Thomas
2021-07-22 23:55:30 -07:00
parent b4e791a21c
commit 9f5a3a5ad8
13 changed files with 300 additions and 25 deletions

View File

@@ -1,7 +1,10 @@
<template>
<v-form v-model="valid">
<v-container>
<v-col cols="12" class="mb-4">
<v-col
cols="12"
class="mb-4"
>
<h1 class="display-2 font-weight-bold mb-3">
Login
</h1>
@@ -31,6 +34,13 @@
required
/>
</v-col>
<v-btn
class="mx-3 mb-5"
@click="login"
>
Login
</v-btn>
</v-container>
</v-form>
</template>
@@ -47,6 +57,22 @@ export default {
passwordRules: [
v => !!v || 'Password is required'
]
})
}),
methods: {
login () {
this.$http.post('https://localhost:3000/login/password', {
username: this.username,
password: this.password
})
.then(response => {
if (response.status === 200) {
this.$router.push('/')
}
})
.catch(function (error) {
console.error(error.response)
})
}
}
}
</script>