animus/js/authenticate.js
2025-02-09 20:55:37 +08:00

21 lines
562 B
JavaScript

function bindAuthenticate() {
$("#password-input").onkeypress = function(e) {
console.log("Asking for authentication");
var keycode = e.code || e.key;
if(keycode == "Enter"){
const selectedUser = users[currentUser].id;
lightdm.authenticate(selectedUser);
return;
}
}
lightdm.show_prompt.connect((text, type) => {
lightdm.respond($("#password-input").value);
});
lightdm.authentication_complete.connect(() => {
const selectedSession = sessions[currentSession].id;
lightdm.start_session(selectedSession);
});
}