Fix error property already defined as a function

This commit is contained in:
kolaente 2021-07-09 19:10:25 +02:00
parent eac4f88a65
commit aebfde0c74
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -25,8 +25,8 @@
{{ $t('user.auth.login') }} {{ $t('user.auth.login') }}
</x-button> </x-button>
<div class="notification is-danger mt-4" v-if="error !== ''"> <div class="notification is-danger mt-4" v-if="errorMessage !== ''">
{{ error }} {{ errorMessage }}
</div> </div>
</div> </div>
</div> </div>
@ -42,7 +42,7 @@ export default {
return { return {
loading: true, loading: true,
authenticateWithPassword: false, authenticateWithPassword: false,
error: '', errorMessage: '',
hash: '', hash: '',
password: '', password: '',
@ -59,7 +59,7 @@ export default {
}), }),
methods: { methods: {
auth() { auth() {
this.error = '' this.errorMessage = ''
if (this.authLinkShare) { if (this.authLinkShare) {
return return
@ -77,15 +77,15 @@ export default {
return return
} }
// TODO: Put this logic in a global error handler method which checks all auth codes // TODO: Put this logic in a global errorMessage handler method which checks all auth codes
let error = this.$t('sharing.error') let errorMessage = this.$t('sharing.errorMessage')
if (e.response && e.response.data && e.response.data.message) { if (e.response && e.response.data && e.response.data.message) {
error = e.response.data.message errorMessage = e.response.data.message
} }
if (typeof e.response.data.code !== 'undefined' && e.response.data.code === 13002) { if (typeof e.response.data.code !== 'undefined' && e.response.data.code === 13002) {
error = this.$t('sharing.invalidPassword') errorMessage = this.$t('sharing.invalidPassword')
} }
this.error = error this.errorMessage = errorMessage
}) })
.finally(() => { .finally(() => {
this.loading = false this.loading = false