Skip to content

Commit e9056a3

Browse files
committed
prevent debug mode from printing password chars
1 parent fe22c81 commit e9056a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

client/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ async function initGreeter(): Promise<void> {
7474
// Add reboot keybind to reboot on ctrl+alt+del
7575
// only when the lock screen is not shown
7676
document.addEventListener('keydown', (e) => {
77-
if (window.debugKeys) {
77+
const isPasswordInput = (document.activeElement?.tagName === 'INPUT' && document.activeElement?.getAttribute('type') === 'password');
78+
if (window.debugKeys && !isPasswordInput) {
7879
window.ui.setDebugInfo(`Key pressed: ${e.code} (${e.key})${e.ctrlKey ? ' + Ctrl' : ''}${e.altKey ? ' + Alt' : ''}${e.shiftKey ? ' + Shift' : ''}${e.metaKey ? ' + Meta' : ''}`);
7980
}
8081
if (e.ctrlKey && e.altKey) { // Special keybinds

0 commit comments

Comments
 (0)