Removed returns
This commit is contained in:
parent
86f2510f3a
commit
53daa758a8
@ -90,7 +90,7 @@ async function loginFunc() {
|
||||
// check if username and password are valid
|
||||
if (username.value === '' || password.value === '') {
|
||||
loginError.value = 'Please enter a valid username and password'
|
||||
return loginError
|
||||
return
|
||||
}
|
||||
|
||||
// send login event to server
|
||||
@ -98,7 +98,7 @@ async function loginFunc() {
|
||||
|
||||
if (response.success === undefined) {
|
||||
loginError.value = response.error
|
||||
return loginError
|
||||
return
|
||||
}
|
||||
gameStore.setToken(response.token)
|
||||
gameStore.initConnection()
|
||||
@ -109,7 +109,7 @@ async function registerFunc() {
|
||||
// check if username and password are valid
|
||||
if (username.value === '' || password.value === '') {
|
||||
loginError.value = 'Please enter a valid username and password'
|
||||
return loginError
|
||||
return
|
||||
}
|
||||
|
||||
// send register event to server
|
||||
@ -117,13 +117,13 @@ async function registerFunc() {
|
||||
|
||||
if (response.success === undefined) {
|
||||
loginError.value = response.error
|
||||
return loginError
|
||||
return
|
||||
}
|
||||
|
||||
const loginSuccess = await loginFunc()
|
||||
if (!loginSuccess) {
|
||||
loginError.value = 'Login after registration failed. Please try logging in manually.'
|
||||
return loginError
|
||||
return
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user