Fixed redirect to login page #33

Merged
konrad merged 1 commits from fix/link-share-redirect into master 2019-09-09 18:36:31 +00:00
3 changed files with 4 additions and 10 deletions

View File

@ -122,6 +122,7 @@
</div>
</div>
</div>
<!-- FIXME: This will only be triggered when the root component is already loaded before doing link share auth. Will "fix" itself once we use vuex. -->
<div v-else-if="user.authenticated && user.infos.type === authTypes.LINK_SHARE">
<div class="container has-text-centered link-share-view">
<div class="column is-10 is-offset-1">

View File

@ -26,6 +26,7 @@
import ListModel from '../../models/list'
import ListService from '../../services/list'
import authType from '../../models/authTypes'
export default {
data() {
@ -41,12 +42,12 @@
},
beforeMount() {
// Check if the user is already logged in, if so, redirect him to the homepage
if (!auth.user.authenticated && !auth.user.isLinkShareAuth) {
if (!auth.user.authenticated && auth.user.infos.type !== authType.LINK_SHARE) {
router.push({name: 'home'})
}
// If the type is invalid, redirect the user
if (this.$route.params.type !== 'gantt' && this.$route.params.type !== '') {
if (auth.user.authenticated && auth.user.infos.type !== authType.LINK_SHARE && this.$route.params.type !== 'gantt' && this.$route.params.type !== '') {
router.push({name: 'showList', params: { id: this.$route.params.id }})
}
},

View File

@ -83,8 +83,6 @@
</template>
<script>
import auth from '../../auth'
import router from '../../router'
import message from '../../message'
import ListService from '../../services/list'
@ -121,12 +119,6 @@
this.list = this.theList
}
},
beforeMount() {
// Check if the user is already logged in, if so, redirect him to the homepage
if (!auth.user.authenticated) {
router.push({name: 'home'})
}
},
created() {
this.listService = new ListService()
this.taskService = new TaskService()