gdm: Merge some duplicate code
Do a reset at initialization time. Technically, this isn't needed, since to start the process we'll need to reset(); anyway after all the signals have connected, but this helps the code be clean.
This commit is contained in:
parent
b978d99820
commit
0b9d01a1c0
@ -131,7 +131,6 @@ const ShellUserVerifier = new Lang.Class({
|
|||||||
this._settings = new Gio.Settings({ schema: LOGIN_SCREEN_SCHEMA });
|
this._settings = new Gio.Settings({ schema: LOGIN_SCREEN_SCHEMA });
|
||||||
this._settings.connect('changed',
|
this._settings.connect('changed',
|
||||||
Lang.bind(this, this._updateDefaultService));
|
Lang.bind(this, this._updateDefaultService));
|
||||||
this._updateDefaultService();
|
|
||||||
|
|
||||||
this._fprintManager = new Fprint.FprintManager();
|
this._fprintManager = new Fprint.FprintManager();
|
||||||
this._smartcardManager = SmartcardManager.getSmartcardManager();
|
this._smartcardManager = SmartcardManager.getSmartcardManager();
|
||||||
@ -152,8 +151,6 @@ const ShellUserVerifier = new Lang.Class({
|
|||||||
this.hasPendingMessages = false;
|
this.hasPendingMessages = false;
|
||||||
this.reauthenticating = false;
|
this.reauthenticating = false;
|
||||||
|
|
||||||
this._failCounter = 0;
|
|
||||||
|
|
||||||
this._oVirtCredentialsManager = OVirt.getOVirtCredentialsManager();
|
this._oVirtCredentialsManager = OVirt.getOVirtCredentialsManager();
|
||||||
|
|
||||||
if (this._oVirtCredentialsManager.hasToken())
|
if (this._oVirtCredentialsManager.hasToken())
|
||||||
@ -161,6 +158,15 @@ const ShellUserVerifier = new Lang.Class({
|
|||||||
|
|
||||||
this._oVirtCredentialsManager.connect('user-authenticated',
|
this._oVirtCredentialsManager.connect('user-authenticated',
|
||||||
Lang.bind(this, this._oVirtUserAuthenticated));
|
Lang.bind(this, this._oVirtUserAuthenticated));
|
||||||
|
|
||||||
|
this._reset();
|
||||||
|
},
|
||||||
|
|
||||||
|
_reset: function() {
|
||||||
|
// Clear previous attempts to authenticate
|
||||||
|
this._failCounter = 0;
|
||||||
|
this._updateDefaultService();
|
||||||
|
this.emit('reset');
|
||||||
},
|
},
|
||||||
|
|
||||||
begin: function(userName) {
|
begin: function(userName) {
|
||||||
@ -472,11 +478,7 @@ const ShellUserVerifier = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_onReset: function() {
|
_onReset: function() {
|
||||||
// Clear previous attempts to authenticate
|
this._reset();
|
||||||
this._failCounter = 0;
|
|
||||||
this._updateDefaultService();
|
|
||||||
|
|
||||||
this.emit('reset');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_onVerificationComplete: function() {
|
_onVerificationComplete: function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user