Recognize "gpass-" before version protocol to avoid (configuration) errors
gPass now blocks login action when the password is not found in database
This commit is contained in:
parent
637d74b8dd
commit
3e5fa8c638
|
@ -54,7 +54,7 @@ function debug(s)
|
||||||
console.log(s);
|
console.log(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
function on_sumbit()
|
function on_sumbit(e)
|
||||||
{
|
{
|
||||||
var form = this;
|
var form = this;
|
||||||
var fields = form.getElementsByTagName("input");
|
var fields = form.getElementsByTagName("input");
|
||||||
|
@ -130,9 +130,11 @@ function on_sumbit()
|
||||||
r = this.responseText.split("\n");
|
r = this.responseText.split("\n");
|
||||||
debug("resp " + r);
|
debug("resp " + r);
|
||||||
protocol = r[0].split("=");
|
protocol = r[0].split("=");
|
||||||
if (protocol[1] != "1")
|
if ((protocol.length == 2 && protocol[1] != "1" && protocol[1] != "gpass-1") || protocol.length != 2)
|
||||||
{
|
{
|
||||||
ret = false;
|
ret = false;
|
||||||
|
if (protocol.length == 2 && protocol[1].startsWith("gpass"))
|
||||||
|
{
|
||||||
notifications.notify({
|
notifications.notify({
|
||||||
title: "gPasss",
|
title: "gPasss",
|
||||||
text: "Protocol version not supported, please upgrade your addon",
|
text: "Protocol version not supported, please upgrade your addon",
|
||||||
|
@ -140,6 +142,15 @@ function on_sumbit()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
notifications.notify({
|
||||||
|
title: "gPasss",
|
||||||
|
text: "Error : It seems that it's not a gPass server",
|
||||||
|
data: this.responseText,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (r[1] != "<end>" && r[1].startsWith("pass="))
|
if (r[1] != "<end>" && r[1].startsWith("pass="))
|
||||||
{
|
{
|
||||||
|
@ -183,7 +194,11 @@ function on_sumbit()
|
||||||
gPassRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
|
gPassRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
|
||||||
gPassRequest.send(keys);
|
gPassRequest.send(keys);
|
||||||
|
|
||||||
if (!ret) return ret;
|
if (!ret)
|
||||||
|
{
|
||||||
|
e.preventDefault();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user