mirror of https://github.com/calzoneman/sync.git
Alert on wrong credentials (#76)
This commit is contained in:
parent
6a3e248ea5
commit
ab3dd208c3
1
api.js
1
api.js
|
@ -156,6 +156,7 @@ function handleLogin(params, req, res) {
|
|||
}
|
||||
else {
|
||||
sendJSON(res, {
|
||||
error: "Invalid session",
|
||||
success: false
|
||||
});
|
||||
}
|
||||
|
|
|
@ -949,7 +949,13 @@ function showLoginFrame() {
|
|||
var data = e.data.substring(e.data.indexOf(":")+1);
|
||||
data = JSON.parse(data);
|
||||
if(data.error) {
|
||||
alert(data.error);
|
||||
// Since this is the login page, invalid session implies bad credentials
|
||||
if(data.error == "Invalid session") {
|
||||
alert("Invalid username/password");
|
||||
}
|
||||
else {
|
||||
alert(data.error);
|
||||
}
|
||||
}
|
||||
else if(data.success) {
|
||||
session = data.session || "";
|
||||
|
|
Loading…
Reference in New Issue