Add logout button to license activation page
This commit is contained in:
parent
47b5d2e037
commit
80382d6bb5
|
|
@ -0,0 +1,15 @@
|
||||||
|
import LOGOUT_MUTATION from '@/graphql/gql/mutations/logoutUser';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
logout() {
|
||||||
|
this.$apollo.mutate({
|
||||||
|
mutation: LOGOUT_MUTATION,
|
||||||
|
}).then(({data}) => {
|
||||||
|
if (data.logout.success) {
|
||||||
|
location.replace('/');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -40,12 +40,12 @@
|
||||||
<script>
|
<script>
|
||||||
import JOIN_CLASS_MUTATION from '@/graphql/gql/mutations/joinClass.gql';
|
import JOIN_CLASS_MUTATION from '@/graphql/gql/mutations/joinClass.gql';
|
||||||
import MY_SCHOOL_CLASS_QUERY from '@/graphql/gql/mySchoolClass';
|
import MY_SCHOOL_CLASS_QUERY from '@/graphql/gql/mySchoolClass';
|
||||||
import LOGOUT_MUTATION from '@/graphql/gql/mutations/logoutUser.gql';
|
|
||||||
|
|
||||||
import addSchoolClassMixin from '@/mixins/add-school-class';
|
import addSchoolClass from '@/mixins/add-school-class';
|
||||||
|
import logout from '@/mixins/logout';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [addSchoolClassMixin],
|
mixins: [addSchoolClass, logout],
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
code: '',
|
code: '',
|
||||||
|
|
@ -83,15 +83,6 @@
|
||||||
this.error = 'Dieser Zugangscode ist nicht gültig.';
|
this.error = 'Dieser Zugangscode ist nicht gültig.';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
|
||||||
logout() {
|
|
||||||
this.$apollo.mutate({
|
|
||||||
mutation: LOGOUT_MUTATION,
|
|
||||||
}).then(({data}) => {
|
|
||||||
if (data.logout.success) {
|
|
||||||
location.replace('/');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,11 @@
|
||||||
data-cy="coupon-button"
|
data-cy="coupon-button"
|
||||||
label="Coupon abschicken"
|
label="Coupon abschicken"
|
||||||
/>
|
/>
|
||||||
|
<a
|
||||||
|
class="button button--big"
|
||||||
|
data-cy="license-activation-cancel"
|
||||||
|
@click="logout">Abmelden
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -64,13 +69,15 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import me from '@/mixins/me';
|
|
||||||
import REDEEM_COUPON from '@/graphql/gql/mutations/redeemCoupon.gql';
|
import REDEEM_COUPON from '@/graphql/gql/mutations/redeemCoupon.gql';
|
||||||
import ME_QUERY from '@/graphql/gql/meQuery.gql';
|
import ME_QUERY from '@/graphql/gql/meQuery.gql';
|
||||||
import LoadingButton from '@/components/LoadingButton';
|
import LoadingButton from '@/components/LoadingButton';
|
||||||
|
|
||||||
|
import me from '@/mixins/me';
|
||||||
|
import logout from '@/mixins/logout';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [me],
|
mixins: [me, logout],
|
||||||
components: {LoadingButton},
|
components: {LoadingButton},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue