ShellUserVerifier: fix fail counter
If it is updated after checking, it counts the number of failures not including the current one, so it allows one extra attempt. Instead, by updating it before checking, we get the expected result of dropping the curtain at the third password. https://bugzilla.gnome.org/show_bug.cgi?id=687132
This commit is contained in:
parent
04debd1623
commit
b9463d23e8
@ -333,12 +333,11 @@ const ShellUserVerifier = new Lang.Class({
|
|||||||
// Otherwise, we allow ALLOWED_FAILURES attempts. After that, we
|
// Otherwise, we allow ALLOWED_FAILURES attempts. After that, we
|
||||||
// go back to the welcome screen.
|
// go back to the welcome screen.
|
||||||
|
|
||||||
|
this._failCounter++;
|
||||||
let canRetry = retry && this._userName &&
|
let canRetry = retry && this._userName &&
|
||||||
this._failCounter < this._settings.get_int(ALLOWED_FAILURES_KEY);
|
this._failCounter < this._settings.get_int(ALLOWED_FAILURES_KEY);
|
||||||
|
|
||||||
if (canRetry) {
|
if (canRetry) {
|
||||||
this._failCounter++;
|
|
||||||
|
|
||||||
this.clear();
|
this.clear();
|
||||||
this.begin(this._userName, new Batch.Hold());
|
this.begin(this._userName, new Batch.Hold());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user