Skip to content

Commit bef3564

Browse files
authored
Marketplace activation failing for non logged in user (#484)
* Update router.js * Update ActivationCard.vue * Update ActivationCard.vue * Update main.js * Update ActivationCard.vue * Revert "Update main.js" This reverts commit 6ed46ca. * Update ActivationCard.vue * Update ActivationCard.vue * Update ActivationCard.vue * Update ActivationCard.vue * Update ActivationCard.vue
1 parent 77a0109 commit bef3564

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

frontend/src/components/ActivationCard.vue

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export default {
1818
},
1919
data: () => ({
2020
user: null,
21-
activated: false
21+
activated: false,
22+
jwtToken: null
2223
}),
2324
methods: {
2425
getCookie(name) {
@@ -58,12 +59,18 @@ export default {
5859
}<br/>
5960
<b>Email</b>: ${this.user ? this.user.email : ''}<br/>
6061
<b>Activation Status: ${this.activated}</b>`;
61-
},
62-
jwtToken() {
63-
return this.getCookie('gmt') || this.$route.query.gmt;
6462
}
6563
},
6664
mounted() {
65+
const token = this.getCookie('gmt') || this.$route.query.gmt;
66+
if (token) {
67+
this.jwtToken = token;
68+
localStorage.setItem('gmt', token);
69+
} else {
70+
this.jwtToken = localStorage.getItem('gmt');
71+
localStorage.removeItem('gmt');
72+
}
73+
6774
this.performLogin().then(result => {
6875
if (result) {
6976
this.user = {

frontend/src/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ router.beforeEach((to, from, next) => {
149149
if (store.getters.isLoggedIn) {
150150
next();
151151
return;
152-
} else if (to.name === 'myProducts') {
152+
} else if (to.name === 'myProducts' || to.name === 'activation') {
153153
next();
154154
return;
155155
} else {

0 commit comments

Comments
 (0)