1
0

Update dependency cypress to v7 (#453)

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/453
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
This commit is contained in:
renovate
2021-04-09 14:29:07 +00:00
committed by konrad
parent d315bb41a4
commit 7b0d2290fc
6 changed files with 115 additions and 103 deletions

View File

@ -18,9 +18,10 @@ export default {
state.info = info
if (info !== null) {
state.avatarUrl = info.getAvatarUrl()
}
if (info.settings) {
state.settings = info.settings
if (info.settings) {
state.settings = info.settings
}
}
},
setUserSettings(state, settings) {
@ -70,7 +71,6 @@ export default {
// Tell others the user is autheticated
ctx.commit('isLinkShareAuth', false)
console.log('login')
ctx.dispatch('checkAuth')
return Promise.resolve()
})
@ -81,12 +81,13 @@ export default {
return Promise.reject()
}
let errorMsg = e.response.data.message
let errorMsg = typeof e.response.data.message !== 'undefined' ? e.response.data.message : null
if (e.response.status === 401) {
errorMsg = 'Wrong username or password.'
}
ctx.commit(ERROR_MESSAGE, errorMsg, {root: true})
}
return Promise.reject()
})
.finally(() => {
@ -106,10 +107,11 @@ export default {
return ctx.dispatch('login', credentials)
})
.catch(e => {
if (e.response) {
if (e.response && e.response.data && e.response.data.message) {
ctx.commit(ERROR_MESSAGE, e.response.data.message, {root: true})
}
return Promise.reject()
return Promise.reject(e)
})
.finally(() => {
ctx.commit(LOADING, false, {root: true})
@ -137,7 +139,7 @@ export default {
})
.catch(e => {
if (e.response) {
let errorMsg = e.response.data.message
let errorMsg = typeof e.response.data.message !== 'undefined' ? e.response.data.message : null
if (e.response.status === 401) {
errorMsg = 'Wrong username or password.'
}

View File

@ -1,5 +1,5 @@
<template>
<div class="message is-centered is-info" v-if="loading">
<div class="message is-centered is-info">
<div class="message-header">
<p class="has-text-centered">
Authenticating...
@ -9,14 +9,14 @@
</template>
<script>
import router from '../../router'
import {mapState} from 'vuex'
import authTypes from '@/models/authTypes.json'
export default {
name: 'LinkSharingAuth',
data() {
return {
hash: '',
loading: true,
}
},
created() {
@ -25,12 +25,19 @@ export default {
mounted() {
this.setTitle('Authenticating...')
},
computed: mapState({
authLinkShare: state => state.auth.authenticated && (state.auth.info && state.auth.info.type === authTypes.LINK_SHARE),
}),
methods: {
auth() {
if (this.authLinkShare) {
return
}
this.$store.dispatch('auth/linkShareAuth', this.$route.params.share)
.then((r) => {
this.loading = false
router.push({name: 'list.list', params: {listId: r.list_id}})
console.log('after link share auth')
this.$router.push({name: 'list.list', params: {listId: r.list_id}})
})
.catch(e => {
this.error(e, this)

View File

@ -171,11 +171,7 @@ export default {
}
this.$store.dispatch('auth/login', credentials)
.then(() => {
router.push({name: 'home'})
})
.catch(() => {
})
.catch(() => {})
},
redirectToProvider(provider) {
const state = Math.random().toString(36).substring(2, 24)

View File

@ -145,6 +145,7 @@ export default {
}
this.$store.dispatch('auth/register', credentials)
.catch(() => {})
},
},
}