An online poker tracker for PokerTH (https://pokerth.net). Continuation of https://github.com/Pik-9/PokerTH-Tracker https://finda.fish
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

62 lines
1.2 KiB

<template>
<v-container>
<v-row justify="center">
<v-col cols=8 v-show="success">
<v-alert type="success">
{{ $t('free-token-suc') }}
</v-alert>
</v-col>
<v-col cols=8 v-show="error">
<v-alert type="error">
{{ $t('free-token-error') }}
</v-alert>
</v-col>
</v-row>
<v-row justify="center">
<v-col cols=2>
<v-btn :disabled="loading" @click="fetchFreeToken">{{ $t('get-free-token') }}</v-btn>
</v-col>
</v-row>
<v-row>
</v-row>
</v-container>
</template>
<script>
export default {
data() {
return {
loading: false,
success: false,
error: false,
};
},
methods: {
fetchFreeToken() {
this.loading = true;
this.$axios.$get('/api/token').then((tkn) => {
this.error = false;
this.success = true;
this.$auth.setUserToken(tkn);
}).catch((error) => {
this.loading = false;
this.success = false;
this.error = true;
/* eslint-disable-next-line no-console */
console.error(error);
});
},
},
head() {
return {
title: this.$t('free-pagetitle'),
};
},
};
</script>