44 lines
1.2 KiB
Vue
44 lines
1.2 KiB
Vue
|
<template>
|
||
|
<div class="w-full text-primary flex items-center flex-col">
|
||
|
<div v-if="!user.minecraft.uuid" class="flex flex-col items-center">
|
||
|
<p class="max-w-xl mb-10 sm:text-base text-sm">
|
||
|
Je bent momenteel niet gewhitelist. Om toegang te krijgen tot de Minecraft server moet je in Minecraft naar de
|
||
|
server met het ip <span class="highlight">play.polarcraft.xeovalyte.com</span> gaan. Vervolgens krijg je een code
|
||
|
te zien, vul deze code hieronder in.
|
||
|
</p>
|
||
|
<div class="flex gap-2">
|
||
|
<Input v-model:value="code">Code</Input>
|
||
|
<Button @click="submitCode">Submit</Button>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script setup>
|
||
|
definePageMeta({
|
||
|
middleware: ["auth"]
|
||
|
})
|
||
|
|
||
|
const user = useState('user')
|
||
|
const code = ref('')
|
||
|
|
||
|
const submitCode = async () => {
|
||
|
try {
|
||
|
const response = await $fetch('/api/minecraft/whitelist', {
|
||
|
method: 'POST',
|
||
|
body: {
|
||
|
code: code.value
|
||
|
}
|
||
|
})
|
||
|
|
||
|
user.value.minecraft.uuid = response.uuid
|
||
|
user.value.minecraft.username = response.username
|
||
|
|
||
|
useToast().success('Successfully whitelisted')
|
||
|
} catch (e) {
|
||
|
console.log(e);
|
||
|
useToast().error(e.statusMessage)
|
||
|
}
|
||
|
}
|
||
|
</script>
|