added beginning of whitelist system
This commit is contained in:
parent
fa0a9b8e58
commit
796b156e8d
13
web/app.vue
13
web/app.vue
@ -1,3 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<NuxtPage />
|
<div class="w-full h-screen overflow-y-auto">
|
||||||
|
<NuxtLayout :name="layout" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
const layout = computed(() => {
|
||||||
|
if (route.path === '/login') { return 'blank' }
|
||||||
|
return 'default'
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
.sidebar-item {
|
||||||
|
@apply font-medium text-lg w-full px-4 py-2 rounded hover:bg-white hover:bg-opacity-5 hover:cursor-pointer flex items-center
|
||||||
|
}
|
||||||
|
|
||||||
|
.highlight {
|
||||||
|
@apply bg-primary bg-opacity-20 px-2 rounded
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.router-link-active {
|
||||||
|
background-color: rgba(0, 0, 0, 20%)
|
||||||
|
}
|
||||||
|
BIN
web/assets/pictures/diamond_wall.png
Normal file
BIN
web/assets/pictures/diamond_wall.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 MiB |
19
web/components/layout/Navbar.vue
Normal file
19
web/components/layout/Navbar.vue
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<template>
|
||||||
|
<div class="bg-neutral-800 border-b border-b-gray-700 flex items-center px-5">
|
||||||
|
<h1 class="text-primary text-2xl font-bold">Polarcraft</h1>
|
||||||
|
<Button outline class="ml-auto" @click="logout">Logout</Button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const logout = async () => {
|
||||||
|
try {
|
||||||
|
await useFetch('/api/auth/logout')
|
||||||
|
|
||||||
|
navigateTo('/login')
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
alert(err.statusMessage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
35
web/components/layout/Sidebar.vue
Normal file
35
web/components/layout/Sidebar.vue
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<template>
|
||||||
|
<div class="bg-neutral-800 text-gray-300 px-2 pt-5 pb-14 flex flex-col">
|
||||||
|
<NuxtLink to="/" class="sidebar-item">
|
||||||
|
<Icon size="1.5em" name="ph:house" class="mr-3" />
|
||||||
|
Home
|
||||||
|
</NuxtLink>
|
||||||
|
<NuxtLink to="/whitelist" class="sidebar-item">
|
||||||
|
<Icon size="1.5em" name="ph:shield-check" class="mr-3" />
|
||||||
|
Whitelist
|
||||||
|
</NuxtLink>
|
||||||
|
<NuxtLink to="/" class="sidebar-item">
|
||||||
|
<Icon size="1.5em" name="ph:users-three" class="mr-3" />
|
||||||
|
Team
|
||||||
|
</NuxtLink>
|
||||||
|
<NuxtLink to="/" class="sidebar-item">
|
||||||
|
<Icon size="1.5em" name="ph:storefront" class="mr-3" />
|
||||||
|
Player stores
|
||||||
|
</NuxtLink>
|
||||||
|
<NuxtLink to="/" class="sidebar-item">
|
||||||
|
<Icon size="1.5em" name="ph:storefront" class="mr-3" />
|
||||||
|
Donation store
|
||||||
|
</NuxtLink>
|
||||||
|
<div v-if="user && user.admin" class="mt-auto">
|
||||||
|
<h2 class="ml-2 text-gray-400">Adminstration</h2>
|
||||||
|
<NuxtLink to="/admin/users" class="sidebar-item">
|
||||||
|
<Icon size="1.5em" name="ph:users-three" class="mr-3" />
|
||||||
|
Users
|
||||||
|
</NuxtLink>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const user = useState('user')
|
||||||
|
</script>
|
3
web/layouts/blank.vue
Normal file
3
web/layouts/blank.vue
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<template>
|
||||||
|
<NuxtPage />
|
||||||
|
</template>
|
16
web/layouts/default.vue
Normal file
16
web/layouts/default.vue
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<template>
|
||||||
|
<div class="h-full bg-neutral-900">
|
||||||
|
<div class="hidden sm:grid grid-cols-desktoplayout grid-rows-desktoplayout h-full">
|
||||||
|
<LayoutNavbar class="col-span-2" />
|
||||||
|
<LayoutSidebar class="" />
|
||||||
|
<div class="overflow-y-auto px-10 pt-5">
|
||||||
|
<NuxtPage />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sm:hidden h-full">
|
||||||
|
<div class="overflow-y-auto px-2 py-2">
|
||||||
|
<NuxtPage />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
@ -14,5 +14,11 @@ export default defineNuxtConfig({
|
|||||||
discordSecret: '',
|
discordSecret: '',
|
||||||
jwtSecret: '',
|
jwtSecret: '',
|
||||||
dbUrl: '',
|
dbUrl: '',
|
||||||
|
mineckerHost: '',
|
||||||
|
mineckerApiKey: '',
|
||||||
|
mincecraftContainer: 'mc-school',
|
||||||
|
public: {
|
||||||
|
redirectUrl: 'https://discord.com/api/oauth2/authorize?client_id=1052974736432443432&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Fauth&response_type=code&scope=identify',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
245
web/package-lock.json
generated
245
web/package-lock.json
generated
@ -12,15 +12,16 @@
|
|||||||
"@xeovalyte/nuxt-xvui": "git+https://gitea.xeovalyte.dev/xeovalyte/nuxt-xvui.git",
|
"@xeovalyte/nuxt-xvui": "git+https://gitea.xeovalyte.dev/xeovalyte/nuxt-xvui.git",
|
||||||
"jsonwebtoken": "^9.0.0",
|
"jsonwebtoken": "^9.0.0",
|
||||||
"mongodb": "^5.3.0",
|
"mongodb": "^5.3.0",
|
||||||
|
"socket.io-client": "^4.6.1",
|
||||||
"surrealdb.js": "^0.6.0"
|
"surrealdb.js": "^0.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nuxt/devtools": "^0.4.1",
|
"@nuxt/devtools": "^0.4.2",
|
||||||
"@nuxtjs/eslint-module": "^4.0.2",
|
"@nuxtjs/eslint-module": "^4.0.2",
|
||||||
"@nuxtjs/tailwindcss": "^6.6.6",
|
"@nuxtjs/tailwindcss": "^6.6.6",
|
||||||
"@types/node": "^18",
|
"@types/node": "^18",
|
||||||
"eslint": "^8.38.0",
|
"eslint": "^8.39.0",
|
||||||
"nuxt": "^3.4.1",
|
"nuxt": "^3.4.2",
|
||||||
"nuxt-icon": "^0.3.3"
|
"nuxt-icon": "^0.3.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1060,9 +1061,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/js": {
|
"node_modules/@eslint/js": {
|
||||||
"version": "8.38.0",
|
"version": "8.39.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.38.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.39.0.tgz",
|
||||||
"integrity": "sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g==",
|
"integrity": "sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||||
}
|
}
|
||||||
@ -1487,14 +1488,14 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@nuxt/devtools": {
|
"node_modules/@nuxt/devtools": {
|
||||||
"version": "0.4.1",
|
"version": "0.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nuxt/devtools/-/devtools-0.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@nuxt/devtools/-/devtools-0.4.2.tgz",
|
||||||
"integrity": "sha512-c3FDYAtNRSEBlrbhLqPCALPgQQIP07sXUZ1XRuUIuFSTBxAKmvMhrwyrVxE9TSdUHvZNreSHt6vy3KD384eRJA==",
|
"integrity": "sha512-+x+rC4Ur9bO7uP7fVkZkmkZUOoYKOxORQGXWb//QsfjtRQLmcTHGOyqZVj8GwB05WLCs//HOg433tJ6Yfxl7Lw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/devtools-kit": "0.4.1",
|
"@nuxt/devtools-kit": "0.4.2",
|
||||||
"@nuxt/devtools-wizard": "0.4.1",
|
"@nuxt/devtools-wizard": "0.4.2",
|
||||||
"@nuxt/kit": "^3.4.1",
|
"@nuxt/kit": "^3.4.2",
|
||||||
"birpc": "^0.2.11",
|
"birpc": "^0.2.11",
|
||||||
"consola": "^3.1.0",
|
"consola": "^3.1.0",
|
||||||
"execa": "^7.1.1",
|
"execa": "^7.1.1",
|
||||||
@ -1508,7 +1509,7 @@
|
|||||||
"launch-editor": "^2.6.0",
|
"launch-editor": "^2.6.0",
|
||||||
"local-pkg": "^0.4.3",
|
"local-pkg": "^0.4.3",
|
||||||
"nypm": "^0.2.0",
|
"nypm": "^0.2.0",
|
||||||
"pacote": "^15.1.1",
|
"pacote": "^15.1.2",
|
||||||
"pathe": "^1.1.0",
|
"pathe": "^1.1.0",
|
||||||
"picocolors": "^1.0.0",
|
"picocolors": "^1.0.0",
|
||||||
"pkg-types": "^1.0.2",
|
"pkg-types": "^1.0.2",
|
||||||
@ -1517,7 +1518,7 @@
|
|||||||
"sirv": "^2.0.2",
|
"sirv": "^2.0.2",
|
||||||
"tinyws": "^0.1.0",
|
"tinyws": "^0.1.0",
|
||||||
"unimport": "^3.0.6",
|
"unimport": "^3.0.6",
|
||||||
"vite-plugin-inspect": "^0.7.22",
|
"vite-plugin-inspect": "^0.7.24",
|
||||||
"vite-plugin-vue-inspector": "^3.4.0",
|
"vite-plugin-vue-inspector": "^3.4.0",
|
||||||
"wait-on": "^7.0.1",
|
"wait-on": "^7.0.1",
|
||||||
"which": "^3.0.0",
|
"which": "^3.0.0",
|
||||||
@ -1527,36 +1528,36 @@
|
|||||||
"devtools": "cli.mjs"
|
"devtools": "cli.mjs"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"nuxt": "^3.3.1",
|
"nuxt": "^3.4.2",
|
||||||
"vite": "*"
|
"vite": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@nuxt/devtools-kit": {
|
"node_modules/@nuxt/devtools-kit": {
|
||||||
"version": "0.4.1",
|
"version": "0.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nuxt/devtools-kit/-/devtools-kit-0.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@nuxt/devtools-kit/-/devtools-kit-0.4.2.tgz",
|
||||||
"integrity": "sha512-iOtrvGKJNp+TkhyJl43jpkmAbVLbkc4lyUv4OWv8/s0RPEXTMRrTlw8llNcGp4DpT+y8ryOFInY/3z0f2l81Rg==",
|
"integrity": "sha512-I1AM4n6Z1KzjaFozFUsnw2M/B1o7pyNBmoOzf6TudkNO3DbmvwufRDXxmn2IghNqcaSibIu1IExfzHSVx5w6IQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/kit": "^3.4.1",
|
"@nuxt/kit": "^3.4.2",
|
||||||
"@nuxt/schema": "^3.4.1",
|
"@nuxt/schema": "^3.4.2",
|
||||||
"execa": "^7.1.1"
|
"execa": "^7.1.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"nuxt": "^3.3.1",
|
"nuxt": "^3.4.2",
|
||||||
"vite": "*"
|
"vite": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@nuxt/devtools-wizard": {
|
"node_modules/@nuxt/devtools-wizard": {
|
||||||
"version": "0.4.1",
|
"version": "0.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nuxt/devtools-wizard/-/devtools-wizard-0.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@nuxt/devtools-wizard/-/devtools-wizard-0.4.2.tgz",
|
||||||
"integrity": "sha512-y8HtwEWjmIzsM88iMLgub2EaYBJGUM7yedMNTId3FkpaPmZD0h01N65hLSlsWBo185WRrSXJWEkygvtjaUzv3w==",
|
"integrity": "sha512-8NShtoJtm3wYW2oXMWDiOY+2kwFkh8Q5ocwZTvdM0X2J9MBHZCHglsSC1OQHSKeFksd0hawjk+sao+r3Yz1hxA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"consola": "^3.1.0",
|
"consola": "^3.1.0",
|
||||||
"diff": "^5.1.0",
|
"diff": "^5.1.0",
|
||||||
"execa": "^7.1.1",
|
"execa": "^7.1.1",
|
||||||
"global-dirs": "^3.0.1",
|
"global-dirs": "^3.0.1",
|
||||||
"magicast": "^0.2.3",
|
"magicast": "^0.2.4",
|
||||||
"pathe": "^1.1.0",
|
"pathe": "^1.1.0",
|
||||||
"picocolors": "^1.0.0",
|
"picocolors": "^1.0.0",
|
||||||
"pkg-types": "^1.0.2",
|
"pkg-types": "^1.0.2",
|
||||||
@ -2124,6 +2125,11 @@
|
|||||||
"integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==",
|
"integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/@socket.io/component-emitter": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg=="
|
||||||
|
},
|
||||||
"node_modules/@tootallnate/once": {
|
"node_modules/@tootallnate/once": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz",
|
||||||
@ -4968,6 +4974,46 @@
|
|||||||
"once": "^1.4.0"
|
"once": "^1.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/engine.io-client": {
|
||||||
|
"version": "6.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.4.0.tgz",
|
||||||
|
"integrity": "sha512-GyKPDyoEha+XZ7iEqam49vz6auPnNJ9ZBfy89f+rMMas8AuiMWOZ9PVzu8xb9ZC6rafUqiGHSCfu22ih66E+1g==",
|
||||||
|
"dependencies": {
|
||||||
|
"@socket.io/component-emitter": "~3.1.0",
|
||||||
|
"debug": "~4.3.1",
|
||||||
|
"engine.io-parser": "~5.0.3",
|
||||||
|
"ws": "~8.11.0",
|
||||||
|
"xmlhttprequest-ssl": "~2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/engine.io-client/node_modules/ws": {
|
||||||
|
"version": "8.11.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz",
|
||||||
|
"integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"bufferutil": "^4.0.1",
|
||||||
|
"utf-8-validate": "^5.0.2"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"bufferutil": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"utf-8-validate": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/engine.io-parser": {
|
||||||
|
"version": "5.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.6.tgz",
|
||||||
|
"integrity": "sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/enhanced-resolve": {
|
"node_modules/enhanced-resolve": {
|
||||||
"version": "5.13.0",
|
"version": "5.13.0",
|
||||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz",
|
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz",
|
||||||
@ -5100,14 +5146,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "8.38.0",
|
"version": "8.39.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.38.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.39.0.tgz",
|
||||||
"integrity": "sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg==",
|
"integrity": "sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
"@eslint-community/regexpp": "^4.4.0",
|
"@eslint-community/regexpp": "^4.4.0",
|
||||||
"@eslint/eslintrc": "^2.0.2",
|
"@eslint/eslintrc": "^2.0.2",
|
||||||
"@eslint/js": "8.38.0",
|
"@eslint/js": "8.39.0",
|
||||||
"@humanwhocodes/config-array": "^0.11.8",
|
"@humanwhocodes/config-array": "^0.11.8",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@nodelib/fs.walk": "^1.2.8",
|
"@nodelib/fs.walk": "^1.2.8",
|
||||||
@ -5117,7 +5163,7 @@
|
|||||||
"debug": "^4.3.2",
|
"debug": "^4.3.2",
|
||||||
"doctrine": "^3.0.0",
|
"doctrine": "^3.0.0",
|
||||||
"escape-string-regexp": "^4.0.0",
|
"escape-string-regexp": "^4.0.0",
|
||||||
"eslint-scope": "^7.1.1",
|
"eslint-scope": "^7.2.0",
|
||||||
"eslint-visitor-keys": "^3.4.0",
|
"eslint-visitor-keys": "^3.4.0",
|
||||||
"espree": "^9.5.1",
|
"espree": "^9.5.1",
|
||||||
"esquery": "^1.4.2",
|
"esquery": "^1.4.2",
|
||||||
@ -11224,6 +11270,32 @@
|
|||||||
"integrity": "sha512-V21+XeNni+tTyiST1MHsa84AQhT1aFZipzPpOFAVB8DkHzwJyjjAmt9bgwnuZiZWnIbMo2duE29wybxv/7HWUw==",
|
"integrity": "sha512-V21+XeNni+tTyiST1MHsa84AQhT1aFZipzPpOFAVB8DkHzwJyjjAmt9bgwnuZiZWnIbMo2duE29wybxv/7HWUw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/socket.io-client": {
|
||||||
|
"version": "4.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.6.1.tgz",
|
||||||
|
"integrity": "sha512-5UswCV6hpaRsNg5kkEHVcbBIXEYoVbMQaHJBXJCyEQ+CiFPV1NIOY0XOFWG4XR4GZcB8Kn6AsRs/9cy9TbqVMQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@socket.io/component-emitter": "~3.1.0",
|
||||||
|
"debug": "~4.3.2",
|
||||||
|
"engine.io-client": "~6.4.0",
|
||||||
|
"socket.io-parser": "~4.2.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/socket.io-parser": {
|
||||||
|
"version": "4.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.2.tgz",
|
||||||
|
"integrity": "sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw==",
|
||||||
|
"dependencies": {
|
||||||
|
"@socket.io/component-emitter": "~3.1.0",
|
||||||
|
"debug": "~4.3.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/socks": {
|
"node_modules/socks": {
|
||||||
"version": "2.7.1",
|
"version": "2.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz",
|
||||||
@ -13200,6 +13272,14 @@
|
|||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/xmlhttprequest-ssl": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/xxhashjs": {
|
"node_modules/xxhashjs": {
|
||||||
"version": "0.2.2",
|
"version": "0.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.2.tgz",
|
||||||
@ -13961,9 +14041,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@eslint/js": {
|
"@eslint/js": {
|
||||||
"version": "8.38.0",
|
"version": "8.39.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.38.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.39.0.tgz",
|
||||||
"integrity": "sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g=="
|
"integrity": "sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng=="
|
||||||
},
|
},
|
||||||
"@gar/promisify": {
|
"@gar/promisify": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
@ -14292,14 +14372,14 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@nuxt/devtools": {
|
"@nuxt/devtools": {
|
||||||
"version": "0.4.1",
|
"version": "0.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nuxt/devtools/-/devtools-0.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@nuxt/devtools/-/devtools-0.4.2.tgz",
|
||||||
"integrity": "sha512-c3FDYAtNRSEBlrbhLqPCALPgQQIP07sXUZ1XRuUIuFSTBxAKmvMhrwyrVxE9TSdUHvZNreSHt6vy3KD384eRJA==",
|
"integrity": "sha512-+x+rC4Ur9bO7uP7fVkZkmkZUOoYKOxORQGXWb//QsfjtRQLmcTHGOyqZVj8GwB05WLCs//HOg433tJ6Yfxl7Lw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@nuxt/devtools-kit": "0.4.1",
|
"@nuxt/devtools-kit": "0.4.2",
|
||||||
"@nuxt/devtools-wizard": "0.4.1",
|
"@nuxt/devtools-wizard": "0.4.2",
|
||||||
"@nuxt/kit": "^3.4.1",
|
"@nuxt/kit": "^3.4.2",
|
||||||
"birpc": "^0.2.11",
|
"birpc": "^0.2.11",
|
||||||
"consola": "^3.1.0",
|
"consola": "^3.1.0",
|
||||||
"execa": "^7.1.1",
|
"execa": "^7.1.1",
|
||||||
@ -14313,7 +14393,7 @@
|
|||||||
"launch-editor": "^2.6.0",
|
"launch-editor": "^2.6.0",
|
||||||
"local-pkg": "^0.4.3",
|
"local-pkg": "^0.4.3",
|
||||||
"nypm": "^0.2.0",
|
"nypm": "^0.2.0",
|
||||||
"pacote": "^15.1.1",
|
"pacote": "^15.1.2",
|
||||||
"pathe": "^1.1.0",
|
"pathe": "^1.1.0",
|
||||||
"picocolors": "^1.0.0",
|
"picocolors": "^1.0.0",
|
||||||
"pkg-types": "^1.0.2",
|
"pkg-types": "^1.0.2",
|
||||||
@ -14322,7 +14402,7 @@
|
|||||||
"sirv": "^2.0.2",
|
"sirv": "^2.0.2",
|
||||||
"tinyws": "^0.1.0",
|
"tinyws": "^0.1.0",
|
||||||
"unimport": "^3.0.6",
|
"unimport": "^3.0.6",
|
||||||
"vite-plugin-inspect": "^0.7.22",
|
"vite-plugin-inspect": "^0.7.24",
|
||||||
"vite-plugin-vue-inspector": "^3.4.0",
|
"vite-plugin-vue-inspector": "^3.4.0",
|
||||||
"wait-on": "^7.0.1",
|
"wait-on": "^7.0.1",
|
||||||
"which": "^3.0.0",
|
"which": "^3.0.0",
|
||||||
@ -14330,27 +14410,27 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@nuxt/devtools-kit": {
|
"@nuxt/devtools-kit": {
|
||||||
"version": "0.4.1",
|
"version": "0.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nuxt/devtools-kit/-/devtools-kit-0.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@nuxt/devtools-kit/-/devtools-kit-0.4.2.tgz",
|
||||||
"integrity": "sha512-iOtrvGKJNp+TkhyJl43jpkmAbVLbkc4lyUv4OWv8/s0RPEXTMRrTlw8llNcGp4DpT+y8ryOFInY/3z0f2l81Rg==",
|
"integrity": "sha512-I1AM4n6Z1KzjaFozFUsnw2M/B1o7pyNBmoOzf6TudkNO3DbmvwufRDXxmn2IghNqcaSibIu1IExfzHSVx5w6IQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@nuxt/kit": "^3.4.1",
|
"@nuxt/kit": "^3.4.2",
|
||||||
"@nuxt/schema": "^3.4.1",
|
"@nuxt/schema": "^3.4.2",
|
||||||
"execa": "^7.1.1"
|
"execa": "^7.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@nuxt/devtools-wizard": {
|
"@nuxt/devtools-wizard": {
|
||||||
"version": "0.4.1",
|
"version": "0.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nuxt/devtools-wizard/-/devtools-wizard-0.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@nuxt/devtools-wizard/-/devtools-wizard-0.4.2.tgz",
|
||||||
"integrity": "sha512-y8HtwEWjmIzsM88iMLgub2EaYBJGUM7yedMNTId3FkpaPmZD0h01N65hLSlsWBo185WRrSXJWEkygvtjaUzv3w==",
|
"integrity": "sha512-8NShtoJtm3wYW2oXMWDiOY+2kwFkh8Q5ocwZTvdM0X2J9MBHZCHglsSC1OQHSKeFksd0hawjk+sao+r3Yz1hxA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"consola": "^3.1.0",
|
"consola": "^3.1.0",
|
||||||
"diff": "^5.1.0",
|
"diff": "^5.1.0",
|
||||||
"execa": "^7.1.1",
|
"execa": "^7.1.1",
|
||||||
"global-dirs": "^3.0.1",
|
"global-dirs": "^3.0.1",
|
||||||
"magicast": "^0.2.3",
|
"magicast": "^0.2.4",
|
||||||
"pathe": "^1.1.0",
|
"pathe": "^1.1.0",
|
||||||
"picocolors": "^1.0.0",
|
"picocolors": "^1.0.0",
|
||||||
"pkg-types": "^1.0.2",
|
"pkg-types": "^1.0.2",
|
||||||
@ -14777,6 +14857,11 @@
|
|||||||
"integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==",
|
"integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"@socket.io/component-emitter": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg=="
|
||||||
|
},
|
||||||
"@tootallnate/once": {
|
"@tootallnate/once": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz",
|
||||||
@ -16922,6 +17007,31 @@
|
|||||||
"once": "^1.4.0"
|
"once": "^1.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"engine.io-client": {
|
||||||
|
"version": "6.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.4.0.tgz",
|
||||||
|
"integrity": "sha512-GyKPDyoEha+XZ7iEqam49vz6auPnNJ9ZBfy89f+rMMas8AuiMWOZ9PVzu8xb9ZC6rafUqiGHSCfu22ih66E+1g==",
|
||||||
|
"requires": {
|
||||||
|
"@socket.io/component-emitter": "~3.1.0",
|
||||||
|
"debug": "~4.3.1",
|
||||||
|
"engine.io-parser": "~5.0.3",
|
||||||
|
"ws": "~8.11.0",
|
||||||
|
"xmlhttprequest-ssl": "~2.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ws": {
|
||||||
|
"version": "8.11.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz",
|
||||||
|
"integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==",
|
||||||
|
"requires": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"engine.io-parser": {
|
||||||
|
"version": "5.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.6.tgz",
|
||||||
|
"integrity": "sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw=="
|
||||||
|
},
|
||||||
"enhanced-resolve": {
|
"enhanced-resolve": {
|
||||||
"version": "5.13.0",
|
"version": "5.13.0",
|
||||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz",
|
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz",
|
||||||
@ -17023,14 +17133,14 @@
|
|||||||
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="
|
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="
|
||||||
},
|
},
|
||||||
"eslint": {
|
"eslint": {
|
||||||
"version": "8.38.0",
|
"version": "8.39.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.38.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.39.0.tgz",
|
||||||
"integrity": "sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg==",
|
"integrity": "sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
"@eslint-community/regexpp": "^4.4.0",
|
"@eslint-community/regexpp": "^4.4.0",
|
||||||
"@eslint/eslintrc": "^2.0.2",
|
"@eslint/eslintrc": "^2.0.2",
|
||||||
"@eslint/js": "8.38.0",
|
"@eslint/js": "8.39.0",
|
||||||
"@humanwhocodes/config-array": "^0.11.8",
|
"@humanwhocodes/config-array": "^0.11.8",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@nodelib/fs.walk": "^1.2.8",
|
"@nodelib/fs.walk": "^1.2.8",
|
||||||
@ -17040,7 +17150,7 @@
|
|||||||
"debug": "^4.3.2",
|
"debug": "^4.3.2",
|
||||||
"doctrine": "^3.0.0",
|
"doctrine": "^3.0.0",
|
||||||
"escape-string-regexp": "^4.0.0",
|
"escape-string-regexp": "^4.0.0",
|
||||||
"eslint-scope": "^7.1.1",
|
"eslint-scope": "^7.2.0",
|
||||||
"eslint-visitor-keys": "^3.4.0",
|
"eslint-visitor-keys": "^3.4.0",
|
||||||
"espree": "^9.5.1",
|
"espree": "^9.5.1",
|
||||||
"esquery": "^1.4.2",
|
"esquery": "^1.4.2",
|
||||||
@ -21506,6 +21616,26 @@
|
|||||||
"integrity": "sha512-V21+XeNni+tTyiST1MHsa84AQhT1aFZipzPpOFAVB8DkHzwJyjjAmt9bgwnuZiZWnIbMo2duE29wybxv/7HWUw==",
|
"integrity": "sha512-V21+XeNni+tTyiST1MHsa84AQhT1aFZipzPpOFAVB8DkHzwJyjjAmt9bgwnuZiZWnIbMo2duE29wybxv/7HWUw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"socket.io-client": {
|
||||||
|
"version": "4.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.6.1.tgz",
|
||||||
|
"integrity": "sha512-5UswCV6hpaRsNg5kkEHVcbBIXEYoVbMQaHJBXJCyEQ+CiFPV1NIOY0XOFWG4XR4GZcB8Kn6AsRs/9cy9TbqVMQ==",
|
||||||
|
"requires": {
|
||||||
|
"@socket.io/component-emitter": "~3.1.0",
|
||||||
|
"debug": "~4.3.2",
|
||||||
|
"engine.io-client": "~6.4.0",
|
||||||
|
"socket.io-parser": "~4.2.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"socket.io-parser": {
|
||||||
|
"version": "4.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.2.tgz",
|
||||||
|
"integrity": "sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw==",
|
||||||
|
"requires": {
|
||||||
|
"@socket.io/component-emitter": "~3.1.0",
|
||||||
|
"debug": "~4.3.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"socks": {
|
"socks": {
|
||||||
"version": "2.7.1",
|
"version": "2.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz",
|
||||||
@ -22892,6 +23022,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz",
|
||||||
"integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw=="
|
"integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw=="
|
||||||
},
|
},
|
||||||
|
"xmlhttprequest-ssl": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A=="
|
||||||
|
},
|
||||||
"xxhashjs": {
|
"xxhashjs": {
|
||||||
"version": "0.2.2",
|
"version": "0.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.2.tgz",
|
||||||
|
@ -10,12 +10,12 @@
|
|||||||
"lint": "eslint ."
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nuxt/devtools": "^0.4.1",
|
"@nuxt/devtools": "^0.4.2",
|
||||||
"@nuxtjs/eslint-module": "^4.0.2",
|
"@nuxtjs/eslint-module": "^4.0.2",
|
||||||
"@nuxtjs/tailwindcss": "^6.6.6",
|
"@nuxtjs/tailwindcss": "^6.6.6",
|
||||||
"@types/node": "^18",
|
"@types/node": "^18",
|
||||||
"eslint": "^8.38.0",
|
"eslint": "^8.39.0",
|
||||||
"nuxt": "^3.4.1",
|
"nuxt": "^3.4.2",
|
||||||
"nuxt-icon": "^0.3.3"
|
"nuxt-icon": "^0.3.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -24,6 +24,7 @@
|
|||||||
"@xeovalyte/nuxt-xvui": "git+https://gitea.xeovalyte.dev/xeovalyte/nuxt-xvui.git",
|
"@xeovalyte/nuxt-xvui": "git+https://gitea.xeovalyte.dev/xeovalyte/nuxt-xvui.git",
|
||||||
"jsonwebtoken": "^9.0.0",
|
"jsonwebtoken": "^9.0.0",
|
||||||
"mongodb": "^5.3.0",
|
"mongodb": "^5.3.0",
|
||||||
|
"socket.io-client": "^4.6.1",
|
||||||
"surrealdb.js": "^0.6.0"
|
"surrealdb.js": "^0.6.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="w-full h-screen bg-neutral-900 text-primary whitespace-pre-wrap">
|
<div class="w-full h-full text-primary flex justify-center items-center flex-col">
|
||||||
HOME SCREEN {{ user }}
|
<h1 class="text-5xl font-bold text-center mb-10">Welkom, {{ user.discord.username }}</h1>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -1,5 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="w-full h-screen bg-neutral-900 text-primary">
|
<div class="w-full h-screen text-primary bg-opacity-0 flex justify-center items-center flex-col px-2">
|
||||||
<a href="https://discord.com/api/oauth2/authorize?client_id=1052974736432443432&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Fauth&response_type=code&scope=identify">Login with Discord</a>
|
<h1 class="sm:text-5xl text-3xl font-bold text-center mb-5">Polarcraft S5</h1>
|
||||||
|
<p class="max-w-xl mb-10 sm:text-base text-sm">
|
||||||
|
<b>Welkom bij Polarcraft seizoen 5!</b> Start door in te loggen met Discord en vervolgens je account te koppelen met Minecraft. Als je problemen hebt maak dan in Discord een ticket aan door het <span class="bg-black bg-opacity-50 px-2 rounded">/ticket</span> commando uit te voeren.
|
||||||
|
</p>
|
||||||
|
<Button @click="navigateTo(config.public.redirectUrl, { external: true })">
|
||||||
|
Log in with Discord
|
||||||
|
<Icon size="1.6em" name="ic:baseline-discord" />
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<div class="absolute top-0 left-0 -z-10 w-full h-screen overflow-hidden">
|
||||||
|
<img src="../assets/pictures/diamond_wall.png" class="h-full w-full object-cover brightness-75 blur-[1px] scale-105">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const config = useRuntimeConfig()
|
||||||
|
</script>
|
||||||
|
38
web/pages/whitelist.vue
Normal file
38
web/pages/whitelist.vue
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<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>
|
@ -3,7 +3,7 @@ export default defineEventHandler(async (event) => {
|
|||||||
|
|
||||||
const config = useRuntimeConfig()
|
const config = useRuntimeConfig()
|
||||||
|
|
||||||
if (!code) sendRedirect(event, '/', 302)
|
if (!code) return sendRedirect(event, '/', 302)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const tokenResponseData = await $fetch('https://discord.com/api/oauth2/token', {
|
const tokenResponseData = await $fetch('https://discord.com/api/oauth2/token', {
|
||||||
@ -39,7 +39,7 @@ export default defineEventHandler(async (event) => {
|
|||||||
|
|
||||||
await coll.updateOne({ 'discord.id': userResult.id }, { $set: doc, $setOnInsert: { minecraft: { uuid: null, username: null }, team: null } }, { upsert: true })
|
await coll.updateOne({ 'discord.id': userResult.id }, { $set: doc, $setOnInsert: { minecraft: { uuid: null, username: null }, team: null } }, { upsert: true })
|
||||||
|
|
||||||
const token = createToken(tokenResponseData.access_token, tokenResponseData.refresh_token, tokenResponseData.expires_in)
|
const token = createToken(tokenResponseData.access_token, tokenResponseData.refresh_token, tokenResponseData.expires_in, userResult.id )
|
||||||
|
|
||||||
setCookie(event, 'jwt', token, { httpOnly: true, maxAge: tokenResponseData.expires_in * 1000 })
|
setCookie(event, 'jwt', token, { httpOnly: true, maxAge: tokenResponseData.expires_in * 1000 })
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
30
web/server/api/minecraft/verifyuuid.js
Normal file
30
web/server/api/minecraft/verifyuuid.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
const auth = getAuth(event)
|
||||||
|
|
||||||
|
const { uuid } = await readBody(event)
|
||||||
|
|
||||||
|
const coll = db.collection('whitelist')
|
||||||
|
|
||||||
|
const doc = await coll.findOne({ uuid: uuid })
|
||||||
|
|
||||||
|
if (doc && !doc.verified) return { code: doc.code, verified: false }
|
||||||
|
if (doc && doc.verified) return { verified: true }
|
||||||
|
|
||||||
|
await coll.createIndex({ code: 1 }, { unique: true })
|
||||||
|
|
||||||
|
const code = await insertDoc(coll, uuid)
|
||||||
|
|
||||||
|
return { code: code.toString(), verified: false }
|
||||||
|
});
|
||||||
|
|
||||||
|
const insertDoc = async (coll, uuid) => {
|
||||||
|
try {
|
||||||
|
const code = Math.floor(100000 + Math.random() * 900000)
|
||||||
|
await coll.insertOne({ uuid: uuid, verified: false, code: code.toString() })
|
||||||
|
|
||||||
|
return code;
|
||||||
|
} catch (e) {
|
||||||
|
const code = await insertDoc(coll, uuid)
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
}
|
22
web/server/api/minecraft/whitelist.js
Normal file
22
web/server/api/minecraft/whitelist.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
const { code } = await readBody(event)
|
||||||
|
|
||||||
|
if (!code) throw createError({ statusCode: 400, statusMessage: 'Code is required'})
|
||||||
|
|
||||||
|
const config = useRuntimeConfig()
|
||||||
|
const auth = await getAuth(event)
|
||||||
|
|
||||||
|
const whitelistColl = db.collection('whitelist')
|
||||||
|
const whitelistDoc = await whitelistColl.findOne({ code: code.toString() })
|
||||||
|
|
||||||
|
if (!whitelistDoc) throw createError({ statusCode: 400, statusMessage: 'Code has not been found, join the server first' })
|
||||||
|
if (whitelistDoc && whitelistDoc.verified) throw createError({ statusCode: 400, statusMessage: 'Already verified' })
|
||||||
|
|
||||||
|
await whitelistColl.updateOne({ code: code.toString() }, { $set: { verified: true } })
|
||||||
|
|
||||||
|
const usersColl = db.collection('users')
|
||||||
|
await usersColl.updateOne({ 'discord.id': auth.discord.id }, { $set: { 'minecraft.uuid': whitelistDoc.uuid } })
|
||||||
|
|
||||||
|
|
||||||
|
return { uuid: whitelistDoc.uuid, verified: false }
|
||||||
|
});
|
@ -2,11 +2,12 @@ import jwt from 'jsonwebtoken'
|
|||||||
|
|
||||||
const config = useRuntimeConfig()
|
const config = useRuntimeConfig()
|
||||||
|
|
||||||
export const createToken = (accessToken, refreshToken, maxAge) => {
|
export const createToken = (accessToken, refreshToken, maxAge, discordId) => {
|
||||||
return jwt.sign({ accessToken, refreshToken }, config.jwtSecret, {
|
return jwt.sign({ accessToken, refreshToken, discordId }, config.jwtSecret, {
|
||||||
expiresIn: maxAge,
|
expiresIn: maxAge,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getAuth = async (event) => {
|
export const getAuth = async (event) => {
|
||||||
const token = getCookie(event, 'jwt') || null
|
const token = getCookie(event, 'jwt') || null
|
||||||
|
|
||||||
@ -31,20 +32,9 @@ export const getAuth = async (event) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let userResult;
|
|
||||||
try {
|
|
||||||
userResult = await $fetch('https://discord.com/api/users/@me', {
|
|
||||||
headers: {
|
|
||||||
authorization: `Bearer ${decodedToken.accessToken}`
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const coll = db.collection("users")
|
const coll = db.collection("users")
|
||||||
const user = await coll.findOne({ 'discord.id': userResult.id })
|
const user = await coll.findOne({ 'discord.id': decodedToken.discordId })
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -4,8 +4,14 @@ module.exports = {
|
|||||||
theme: {
|
theme: {
|
||||||
extend: {
|
extend: {
|
||||||
colors: {
|
colors: {
|
||||||
primary: '#4bd6ef',
|
primary: '#3794B5',
|
||||||
secondary: '#4bacef',
|
secondary: '#4bacef',
|
||||||
|
},
|
||||||
|
gridTemplateColumns: {
|
||||||
|
'desktoplayout': '14rem 1fr'
|
||||||
|
},
|
||||||
|
gridTemplateRows: {
|
||||||
|
'desktoplayout': '3rem 1fr'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user