Skip to content

Commit

Permalink
Marketplace activation failing for non logged in user (#484)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mservidio authored Apr 15, 2021
1 parent 77a0109 commit bef3564
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions frontend/src/components/ActivationCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export default {
},
data: () => ({
user: null,
activated: false
activated: false,
jwtToken: null
}),
methods: {
getCookie(name) {
Expand Down Expand Up @@ -58,12 +59,18 @@ export default {
}<br/>
<b>Email</b>: ${this.user ? this.user.email : ''}<br/>
<b>Activation Status: ${this.activated}</b>`;
},
jwtToken() {
return this.getCookie('gmt') || this.$route.query.gmt;
}
},
mounted() {
const token = this.getCookie('gmt') || this.$route.query.gmt;
if (token) {
this.jwtToken = token;
localStorage.setItem('gmt', token);
} else {
this.jwtToken = localStorage.getItem('gmt');
localStorage.removeItem('gmt');
}
this.performLogin().then(result => {
if (result) {
this.user = {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ router.beforeEach((to, from, next) => {
if (store.getters.isLoggedIn) {
next();
return;
} else if (to.name === 'myProducts') {
} else if (to.name === 'myProducts' || to.name === 'activation') {
next();
return;
} else {
Expand Down

0 comments on commit bef3564

Please sign in to comment.