diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2020-09-08 17:46:09 +0200 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2020-09-08 20:10:18 +0200 |
commit | 68a49f353954bb32289f6e80281b2ed14312f679 (patch) | |
tree | 2dd48cbdc7bc7967244f2e632abd71ec29074333 /pkg/backend | |
parent | e217f990bcdc687b8c0cdf8f84929aaf5aa8f935 (diff) |
[feat] be more precise when login gives 502
Diffstat (limited to 'pkg/backend')
-rw-r--r-- | pkg/backend/api.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/backend/api.go b/pkg/backend/api.go index 1985e6b..ea148f7 100644 --- a/pkg/backend/api.go +++ b/pkg/backend/api.go @@ -18,7 +18,11 @@ func Login(username, password string) { success, err := ctx.bm.DoLogin(username, password) if err != nil { log.Printf("Error on login: %v", err) - ctx.Errors = "bad_auth" + if err.Error() == "Cannot get token: Error 502" { + ctx.Errors = "bad_auth_502" + } else { + ctx.Errors = "bad_auth" + } } else if success { log.Printf("Logged in as %s", username) ctx.LoginOk = true |