summaryrefslogtreecommitdiff
path: root/pkg/backend/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/backend/api.go')
-rw-r--r--pkg/backend/api.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkg/backend/api.go b/pkg/backend/api.go
index 7b48906..6609b1b 100644
--- a/pkg/backend/api.go
+++ b/pkg/backend/api.go
@@ -16,16 +16,19 @@ import (
func Login(username, password string) {
success, err := ctx.bm.DoLogin(username, password)
if err != nil {
- // TODO
- log.Printf("Error login: %v", err)
+ log.Printf("Error on login: %v", err)
+ ctx.Errors = "bad_auth_unknown"
} else if success {
- // TODO: Notify success
log.Printf("Logged in as %s", username)
+ ctx.LoginOk = true
+ ctx.LoginDialog = false
} else {
// TODO: display login again with an err
log.Printf("Failed to login as %s", username)
ctx.LoginDialog = true
+ ctx.Errors = "bad_auth"
}
+ go ctx.updateStatus()
}
func SwitchOn() {