forked from noxious/client
NQ-58 & NQ-57
This commit is contained in:
@ -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>
|
||||
|
||||
|
Reference in New Issue
Block a user