diff --git a/frontend/src/pages/Login.vue b/frontend/src/pages/Login.vue index 9d33678f5..5c3e52521 100755 --- a/frontend/src/pages/Login.vue +++ b/frontend/src/pages/Login.vue @@ -42,6 +42,10 @@ +
+ {{ $t('gdd_per_link.redeem') + ':' }} + {{ $route.params.code }} +
@@ -64,6 +68,7 @@ import InputPassword from '@/components/Inputs/InputPassword' import InputEmail from '@/components/Inputs/InputEmail' import { login } from '@/graphql/queries' import { getCommunityInfoMixin } from '@/mixins/getCommunityInfo' +import { redeemTransactionLink } from '@/graphql/mutations' export default { name: 'Login', @@ -101,7 +106,12 @@ export default { data: { login }, } = result this.$store.dispatch('login', login) + if (this.$route.params.code) { + this.redeemLink(this.$route.params.code) + } + this.$router.push('/overview') + loader.hide() }) .catch((error) => { @@ -114,6 +124,21 @@ export default { loader.hide() }) }, + redeemLink(code) { + this.$apollo + .mutate({ + mutation: redeemTransactionLink, + variables: { + code: code, + }, + }) + .then(() => { + this.toastSuccess(this.$t('gdd_per_link.successfully-redeemed')) + }) + .catch((err) => { + this.toastError(err.message) + }) + }, }, }