diff options
Diffstat (limited to 'pkg/backend/api.go')
| -rw-r--r-- | pkg/backend/api.go | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/pkg/backend/api.go b/pkg/backend/api.go index 1d44f8a..4390fef 100644 --- a/pkg/backend/api.go +++ b/pkg/backend/api.go @@ -18,10 +18,12 @@ import (  func Login(username, password string) {  	success, err := ctx.bm.DoLogin(username, password)  	if err != nil { -		log.Printf("Error on login: %v", err) -		if err.Error() == "Cannot get token: Error 502" { +		if err.Error() == "TokenErrTimeout" { +			ctx.Errors = "bad_auth_timeout" +		} else if err.Error() == "TokenErrBadStatus 502" {  			ctx.Errors = "bad_auth_502"  		} else { +			log.Println("ERROR: bad login", err)  			ctx.Errors = "bad_auth"  		}  	} else if success { @@ -29,7 +31,6 @@ func Login(username, password string) {  		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" | 
