[GH-2857] Allow only macOS to call setSecureKeyboardEntryEnabled (#2860) (#2861)

(cherry picked from commit 2a88175b09)

Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
This commit is contained in:
Mattermost Build 2023-09-28 19:20:19 +03:00 committed by GitHub
parent e4d05b55dd
commit 3df39124a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -149,6 +149,10 @@ export function handlePingDomain(event: IpcMainInvokeEvent, url: string): Promis
}
export function handleToggleSecureInput(event: IpcMainEvent, secureInput: boolean) {
if (process.platform !== 'darwin') {
return;
}
// Enforce macOS to restrict processes from reading the keyboard input when in a password field
log.debug('handleToggleSecureInput', secureInput);
app.setSecureKeyboardEntryEnabled(secureInput);