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
+2
View File
@@ -11,6 +11,8 @@ export interface PlayerNetcode extends GameObjectNetcode {
team: string
username: string
turn: string
discord_id?: string
image?: string
}
+8
View File
@@ -119,6 +119,14 @@ socket.onmessage = function (event) {
}
};
export async function oauth2_register_discord(code: string){
socket.send(JSON.stringify({
type:"discord_login",
data_type:"code",
data:code
}))
}
export async function register(username: string) {
socket.send(JSON.stringify({
type: "register",