1
0
forked from noxious/client

NQ-58 & NQ-57

This commit is contained in:
2024-06-06 19:04:22 +02:00
parent f7ce1c919d
commit 01bbd94a3e
2 changed files with 20 additions and 28 deletions

View File

@ -51,13 +51,11 @@ async function loginFunc() {
}
// send login event to server
const success = await login(username.value, password.value)
const response = await login(username.value, password.value)
if (!success) {
notifications.addNotification({ message: 'Invalid username or password' })
if (response.success === undefined) {
notifications.addNotification({ message: response.error })
}
// if (success) {}
}
async function registerFunc() {
@ -68,13 +66,11 @@ async function registerFunc() {
}
// send register event to server
const success = await register(username.value, password.value)
const response = await register(username.value, password.value)
if (!success) {
notifications.addNotification({ message: 'Username already exists' })
if (response.success === undefined) {
notifications.addNotification({ message: response.error })
}
// if (success) {}
}
</script>