39 lines
1.1 KiB
Vue
39 lines
1.1 KiB
Vue
<template>
|
|
<div class="w-full h-full text-primary flex pt-20 items-center flex-col">
|
|
<h1 class="sm:text-4xl text-2xl font-bold text-center mb-5">Whitelist</h1>
|
|
<p v-if="!user.minecraft.uuid" 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>
|
|
</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
|
|
useToast().success('Successfully whitelisted')
|
|
} catch (e) {
|
|
console.log(e);
|
|
useToast().error(e.statusMessage)
|
|
}
|
|
}
|
|
</script>
|