1
0
forked from noxious/client

Fixed characters not showing after logging in, added loading screen before showing characters, worked on GM tools

This commit is contained in:
2024-06-10 02:39:00 +02:00
parent 2f7153fbfe
commit 3e003962dc
10 changed files with 85 additions and 26 deletions

View File

@ -7,8 +7,7 @@ export async function register(username: string, password: string, socketStore =
try {
const response = await axios.post(`${config.server_endpoint}/register`, { username, password })
useCookies().set('token', response.data.token as string)
await socketStore.setupSocketConnection()
return { success: true }
return { success: true, token: response.data.token}
} catch (error: any) {
return { error: error.response.data.message }
}
@ -18,8 +17,7 @@ export async function login(username: string, password: string, socketStore = us
try {
const response = await axios.post(`${config.server_endpoint}/login`, { username, password })
useCookies().set('token', response.data.token as string)
await socketStore.setupSocketConnection()
return { success: true }
return { success: true, token: response.data.token}
} catch (error: any) {
return { error: error.response.data.message }
}