use computed auth links from mixins

This commit is contained in:
mahula 2022-10-12 18:16:02 +02:00
parent 7702b88083
commit 70e11b8e49
4 changed files with 20 additions and 28 deletions

View File

@ -28,24 +28,17 @@
</template>
<script>
import { authLinks } from '../../mixins/authLinks'
export default {
name: 'AuthNavbar',
mixins: [authLinks],
data() {
return {
logo: '/img/brand/green.png',
sheet: '/img/template/Blaetter.png',
}
},
computed: {
login() {
if (this.$route.params.code) return '/login/' + this.$route.params.code
return '/login'
},
register() {
if (this.$route.params.code) return '/register/' + this.$route.params.code
return '/register'
},
},
}
</script>

View File

@ -11,18 +11,11 @@
</template>
<script>
import { authLinks } from '../../mixins/authLinks'
export default {
name: 'AuthNavbarSmall',
computed: {
login() {
if (this.$route.params.code) return '/login/' + this.$route.params.code
return '/login'
},
register() {
if (this.$route.params.code) return '/register/' + this.$route.params.code
return '/register'
},
},
mixins: [authLinks],
}
</script>
<style scoped>

View File

@ -25,9 +25,11 @@
</template>
<script>
import RedeemInformation from '@/components/LinkInformations/RedeemInformation.vue'
import { authLinks } from '../../mixins/authLinks'
export default {
name: 'RedeemLoggedOut',
mixins: [authLinks],
components: {
RedeemInformation,
},
@ -35,13 +37,5 @@ export default {
linkData: { type: Object, required: true },
isContributionLink: { type: Boolean, default: false },
},
computed: {
login() {
return '/login/' + this.$route.params.code
},
register() {
return '/register/' + this.$route.params.code
},
},
}
</script>

View File

@ -0,0 +1,12 @@
export const authLinks = {
computed: {
login() {
if (this.$route.params.code) return '/login/' + this.$route.params.code
return '/login'
},
register() {
if (this.$route.params.code) return '/register/' + this.$route.params.code
return '/register'
},
},
}