Prepare for CI
This commit is contained in:
@@ -1,20 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
|
||||
import goStore, { register, setReady, oauth2_register_discord } from "@/netcode";
|
||||
import { isStaticProperty } from "vue/compiler-sfc";
|
||||
import goStore, { register, setReady, oauth2_register_discord, setup_websocket } from "@/netcode";
|
||||
|
||||
|
||||
|
||||
const config = useRuntimeConfig()
|
||||
|
||||
await setup_websocket()
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
let username = ref<string>("legonzaur");
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
if (route.path != "/login") {
|
||||
return
|
||||
}
|
||||
const code = route.query.code
|
||||
if (!code) { return }
|
||||
if (Array.isArray(code)) { return }
|
||||
await setup_websocket()
|
||||
oauth2_register_discord(code)
|
||||
|
||||
history.pushState(
|
||||
@@ -24,6 +30,12 @@ onMounted(() => {
|
||||
)
|
||||
})
|
||||
|
||||
async function discordLogin() {
|
||||
await navigateTo(config.public.discordLoginEndpoint, {
|
||||
external: true
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div id="game_status">
|
||||
@@ -36,6 +48,7 @@ onMounted(() => {
|
||||
<template v-if="!goStore.game?.started">
|
||||
<input type="text" v-model="username" />
|
||||
<button @click="register(username)">LOGIN</button>
|
||||
<button @click="discordLogin()">DISCORD</button>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user