Merge pull request #2260 from gradido/2246-bug-redeem-code-is-lost

fix: 🐛 Prevent Loosing Redeem Code When Changing Between Register and Login in Auth Navbar
This commit is contained in:
mahula 2022-10-13 17:34:29 +02:00 committed by GitHub
commit 5c68186d40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 12 deletions

View File

@ -25,6 +25,7 @@ describe('App', () => {
meta: {
requiresAuth: false,
},
params: {},
},
}

View File

@ -18,9 +18,9 @@
<b-img class="sheet-img position-absolute d-block d-lg-none zindex1000" :src="sheet"></b-img>
<b-collapse id="nav-collapse" is-nav class="ml-5">
<b-navbar-nav class="ml-auto d-none d-lg-flex" right>
<b-nav-item to="/register" class="authNavbar ml-lg-5">{{ $t('signup') }}</b-nav-item>
<b-nav-item :to="register" class="authNavbar ml-lg-5">{{ $t('signup') }}</b-nav-item>
<span class="d-none d-lg-block mt-1">{{ $t('math.pipe') }}</span>
<b-nav-item to="/login" class="authNavbar">{{ $t('signin') }}</b-nav-item>
<b-nav-item :to="login" class="authNavbar">{{ $t('signin') }}</b-nav-item>
</b-navbar-nav>
</b-collapse>
</b-navbar>
@ -28,8 +28,11 @@
</template>
<script>
import { authLinks } from '@/mixins/authLinks'
export default {
name: 'AuthNavbar',
mixins: [authLinks],
data() {
return {
logo: '/img/brand/green.png',

View File

@ -2,17 +2,20 @@
<div class="navbar-small">
<b-navbar class="navi">
<b-navbar-nav>
<b-nav-item to="/register" class="authNavbar">{{ $t('signup') }}</b-nav-item>
<b-nav-item :to="register" class="authNavbar">{{ $t('signup') }}</b-nav-item>
<span class="mt-1">{{ $t('math.pipe') }}</span>
<b-nav-item to="/login" class="authNavbar">{{ $t('signin') }}</b-nav-item>
<b-nav-item :to="login" class="authNavbar">{{ $t('signin') }}</b-nav-item>
</b-navbar-nav>
</b-navbar>
</div>
</template>
<script>
import { authLinks } from '@/mixins/authLinks'
export default {
name: 'AuthNavbarSmall',
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

@ -19,6 +19,7 @@ describe('AuthLayout', () => {
meta: {
requiresAuth: false,
},
params: {},
},
}

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'
},
},
}