Fix authenticating a link share twice
Some checks failed
continuous-integration/drone/pr Build is failing

This commit is contained in:
kolaente 2021-04-09 16:06:56 +02:00
parent c40d241bfa
commit b46cfb5987
Signed by: konrad
GPG Key ID: F40E70337AB24C9B

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)