Basic authentication flow
This commit is contained in:
parent
c58cf0e10c
commit
2e38ecd15b
4 changed files with 33 additions and 3 deletions
25
js/authenticate.js
Normal file
25
js/authenticate.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
function authenticate(){
|
||||
const selectedUser = users[currentUser].id;
|
||||
|
||||
lightdm.cancel_authentication();
|
||||
lightdm.authenticate(selectedUser);
|
||||
}
|
||||
|
||||
async function authenticationComplete() {
|
||||
const selectedSession = sessions[currentSession].id;
|
||||
|
||||
await lightdm.respond($("#password-input").value);
|
||||
lightdm.start_session(selectedSession);
|
||||
}
|
||||
|
||||
function bindAuthenticate() {
|
||||
$("#password-input").onkeypress = function(e) {
|
||||
var keycode = e.code || e.key;
|
||||
if(keycode == "Enter"){
|
||||
authenticate();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
window.lightdm.authentication_complete.connect(authenticationComplete);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue