Skip to content
Snippets Groups Projects
Unverified Commit 68a49f35 authored by Kali Kaneko's avatar Kali Kaneko
Browse files

[feat] be more precise when login gives 502

parent e217f990
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,11 @@ ApplicationWindow {
function showInitFailure(msg) {
console.debug("ERRORS:", ctx.errors)
if (msg == undefined) {
if (ctx.errors == 'bad_auth') {
if (ctx.errors == 'bad_auth_502') {
msg = qsTr("Oops! The authentication service seems down. Please try again later")
initFailure.title = qsTr("Service Error")
}
else if (ctx.errors == 'bad_auth') {
if (allowEmptyPass) {
// For now, this is a libraryVPN, so we can be explicit about what credentials are here.
// Another option to consider is to customize the error strings while vendoring.
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment