gnome-shell/gs-fate318433-prevent-same-account-multi-logins.patch
Dominique Leuenberger a7b4d42256 Accepting request 952873 from home:xiaoguang_wang:branches:GNOME:Factory
- Update gs-fate318433-prevent-same-account-multi-logins.patch:
  Fix the JS ERR: Error: Wrong type number; string expected
  (bsc#1195179 bsc#1195141).

OBS-URL: https://build.opensuse.org/request/show/952873
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-shell?expand=0&rev=497
2022-02-09 09:03:40 +00:00

35 lines
1.5 KiB
Diff

Index: gnome-shell-41.3/js/gdm/loginDialog.js
===================================================================
--- gnome-shell-41.3.orig/js/gdm/loginDialog.js
+++ gnome-shell-41.3/js/gdm/loginDialog.js
@@ -1043,6 +1043,29 @@ var LoginDialog = GObject.registerClass(
}
_onSessionOpened(client, serviceName) {
+ if (this._user.get_num_sessions_anywhere() > 1) {
+ this._authPrompt.setMessage(null,
+ _('Sorry, you have to log out a previous session first. Multiple logins are not supported.'),
+ GdmUtil.MessageType.ERROR);
+ // TODO: The following logic relies on the unverified fact that
+ // `AuthPrompt::_onVerificationComplete` seems to always run after
+ // current handler. This might root from the interaction between
+ // greeter and verifier, both are external programs.
+ this._authPrompt.verificationStatus = AuthPrompt.AuthPromptStatus.VERIFIED_BUT_FORBIDDEN;
+ this._authPrompt.cancelButton.reactive = true;
+
+ // NOTE: Failed Attempts as references
+ //
+ // NOTE: reset is too heavy, it skips the error prompt all together
+ // this._authPrompt.reset();
+ //
+ // NOTE: Diconnect at this stage is not working
+ //
+ // this._authPrompt._userVerifier.disconnect(this._authPrompt._userVerifierCompleteId);
+
+ return;
+ }
+
this._authPrompt.finish(() => this._startSession(serviceName));
}