discord login

This commit is contained in:
2024-05-07 23:10:25 +02:00
parent 8a27c425e0
commit b1f6e7016a
4 changed files with 65 additions and 6 deletions
+21 -1
View File
@@ -1,9 +1,29 @@
<script setup lang="ts">
import { ref } from "vue";
import goStore, { register, setReady } from "@/netcode";
import goStore, { register, setReady, oauth2_register_discord } from "@/netcode";
import { isStaticProperty } from "vue/compiler-sfc";
const route = useRoute()
let username = ref<string>("legonzaur");
onMounted(() => {
if (route.path != "/login") {
return
}
const code = route.query.code
if (!code) { return }
if (Array.isArray(code)) { return }
oauth2_register_discord(code)
history.pushState(
{},
'',
'/'
)
})
</script>
<template>
<div id="game_status">