diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js index de777450e7a9d3ffc3d0fa940e9ae67f7b84ff7b..4844b9ee0c7b7845e8526e55f2141f851d9adee0 100644 --- a/js/gdm/authPrompt.js +++ b/js/gdm/authPrompt.js @@ -321,12 +321,17 @@ var AuthPrompt = GObject.registerClass({ _onVerificationFailed(userVerifier, serviceName, canRetry) { const wasQueryingService = this._queryingService === serviceName; - this._queryingService = null; - this.clear(); + + if (wasQueryingService) { + this._queryingService = null; + this.clear(); + } this.updateSensitivity(canRetry); this.setActorInDefaultButtonWell(null); - this.verificationStatus = AuthPromptStatus.VERIFICATION_FAILED; + + if (!canRetry) + this.verificationStatus = AuthPromptStatus.VERIFICATION_FAILED; if (wasQueryingService) Util.wiggle(this._entry); diff --git a/js/gdm/util.js b/js/gdm/util.js index 1ee84acde287a233b098dbd01f8f34ac076a3507..72561daab293b918a536139bad6b9a8026f6e624 100644 --- a/js/gdm/util.js +++ b/js/gdm/util.js @@ -685,29 +685,23 @@ var ShellUserVerifier = class { (this._reauthOnly || this._failCounter < this.allowedFailures); } - _verificationFailed(serviceName, retry) { + _verificationFailed(serviceName, shouldRetry) { + if (serviceName === FINGERPRINT_SERVICE_NAME) { + if (this._fingerprintFailedId) + GLib.source_remove(this._fingerprintFailedId); + } + // For Not Listed / enterprise logins, immediately reset // the dialog // Otherwise, when in login mode we allow ALLOWED_FAILURES attempts. // After that, we go back to the welcome screen. + this._filterServiceMessages(serviceName, MessageType.ERROR); - const canRetry = retry && this._canRetry(); + const doneTrying = !shouldRetry || !this._canRetry(); - this._disconnectSignals(); - this._filterServiceMessages(serviceName, MessageType.ERROR); + if (doneTrying) { + this._disconnectSignals(); - if (canRetry) { - if (!this.hasPendingMessages) { - this._retry(serviceName); - } else { - const cancellable = this._cancellable; - let signalId = this.connect('no-more-messages', () => { - this.disconnect(signalId); - if (!cancellable.is_cancelled()) - this._retry(serviceName); - }); - } - } else { // eslint-disable-next-line no-lonely-if if (!this.hasPendingMessages) { this._cancelAndReset(); @@ -721,7 +715,18 @@ var ShellUserVerifier = class { } } - this.emit('verification-failed', serviceName, canRetry); + this.emit('verification-failed', serviceName, !doneTrying); + + if (!this.hasPendingMessages) { + this._retry(serviceName); + } else { + const cancellable = this._cancellable; + let signalId = this.connect('no-more-messages', () => { + this.disconnect(signalId); + if (!cancellable.is_cancelled()) + this._retry(serviceName); + }); + } } _onServiceUnavailable(_client, serviceName, errorMessage) {