authPrompt: Allow to set a custom ShellUserVerifer

Move ShellUserVerifier creation to its own function so that
extensions can easily override it.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7828
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3446>
This commit is contained in:
Alessandro Bono 2024-08-19 10:42:08 +02:00 committed by Marco Trevisan
parent 3b862b40c4
commit 5445b705f1

View File

@ -74,7 +74,7 @@ export const AuthPrompt = GObject.registerClass({
else if (this._mode === AuthPromptMode.UNLOCK_OR_LOG_IN)
reauthenticationOnly = false;
this._userVerifier = new GdmUtil.ShellUserVerifier(this._gdmClient, {reauthenticationOnly});
this._userVerifier = this._createUserVerifier(this._gdmClient, {reauthenticationOnly});
this._userVerifier.connect('ask-question', this._onAskQuestion.bind(this));
this._userVerifier.connect('show-message', this._onShowMessage.bind(this));
@ -124,6 +124,10 @@ export const AuthPrompt = GObject.registerClass({
this.add_child(this._message);
}
_createUserVerifier(gdmClient, params) {
return new GdmUtil.ShellUserVerifier(gdmClient, params);
}
_onDestroy() {
this._inactiveEntry.destroy();
this._inactiveEntry = null;