Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding password length faker #4

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Amy SDDM Themes/Amy-Light-SDDM/Login.qml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ SessionManagementScreen {
* If username field is visible, it will be taken from that, otherwise from the "name" property of the currentIndex
*/
function startLogin() {
passwordBox.text = passwordBox.text.replace(/▀/g,'');
// Hide the box after stripping the fake length
passwordBox.visible = false;
const username = showUsernamePrompt ? userNameInput.text : userList.selectedUser
const password = passwordBox.text

Expand Down Expand Up @@ -118,11 +121,17 @@ SessionManagementScreen {
userList.incrementCurrentIndex();
event.accepted = true
}
var spaces = ['','▀','▀▀'];
var number = Math.floor(Math.random() * spaces.length);
passwordBox.text = passwordBox.text+spaces[number];
}

Connections {
target: sddm
function onLoginFailed() {
//Unhide the box
passwordBox.text = "";
passwordBox.visible = true;
passwordBox.selectAll()
passwordBox.forceActiveFocus()
}
Expand Down