Compare commits

..

1 Commits

Author SHA1 Message Date
Alf Sebastian Houge
d314ed4a16 Add vscode specific files to gitignore 2022-03-05 19:21:10 +01:00
2 changed files with 26 additions and 8 deletions

4
server/.gitignore vendored
View File

@@ -12,6 +12,10 @@
*.out *.out
*.db *.db
# MS VSCode
.vscode
__debug_bin
# Dependency directories (remove the comment below to include it) # Dependency directories (remove the comment below to include it)
# vendor/ # vendor/
assets/* assets/*

View File

@@ -16,7 +16,7 @@ export default {
password: '', password: '',
authError: null, authError: null,
tryingToLogIn: false, tryingToLogIn: false,
errorMessage: '', errorMessage:''
} }
}, },
computed: { computed: {
@@ -38,7 +38,7 @@ export default {
// and password they provided. // and password they provided.
tryToLogIn() { tryToLogIn() {
this.tryingToLogIn = true this.tryingToLogIn = true
this.errorMessage = '' this.errorMessage='';
// Reset the authError if it existed. // Reset the authError if it existed.
this.authError = null this.authError = null
return this.logIn({ return this.logIn({
@@ -53,9 +53,9 @@ export default {
// Redirect to the originally requested page, or to the home page // Redirect to the originally requested page, or to the home page
}) })
.catch((error) => { .catch((error) => {
if (error.response.data?.errors?.login) { if(error.response.data?.errors?.login){
this.errorMessage = error.response.data.errors.login this.errorMessage=error.response.data.errors.login
} }
this.tryingToLogIn = false this.tryingToLogIn = false
this.authError = error this.authError = error
}) })
@@ -67,9 +67,21 @@ export default {
<template> <template>
<Layout> <Layout>
<form @submit.prevent="tryToLogIn"> <form @submit.prevent="tryToLogIn">
<b-field label="Email"> <b-input v-model="username" tag="b-input" name="username" type="email" :placeholder="placeholders.username"/></b-field> <b-field label="Email">
<b-input
v-model="username"
tag="b-input"
name="username"
:placeholder="placeholders.username"
/></b-field>
<b-field label="Password"> <b-field label="Password">
<b-input v-model="password" tag="b-input" name="password" type="password" :placeholder="placeholders.password" /> <b-input
v-model="password"
tag="b-input"
name="password"
type="password"
:placeholder="placeholders.password"
/>
</b-field> </b-field>
<b-button tag="input" native-type="submit" :disabled="tryingToLogIn" type="is-primary"> <b-button tag="input" native-type="submit" :disabled="tryingToLogIn" type="is-primary">
<BaseIcon v-if="tryingToLogIn" name="sync" spin /> <BaseIcon v-if="tryingToLogIn" name="sync" spin />
@@ -77,7 +89,9 @@ export default {
Log in Log in
</span> </span>
</b-button> </b-button>
<p v-if="authError"> There was an error logging in to your account. {{ errorMessage }} </p> <p v-if="authError">
There was an error logging in to your account. {{errorMessage}}
</p>
</form> </form>
</Layout> </Layout>
</template> </template>