lockscreen: Disable passwordless logins

It seems to cause infinite loops and lock the user out on load right now, investigate later.
This commit is contained in:
Devin Lin 2023-03-31 19:44:30 -07:00
parent d3a39ac2e9
commit afbbe013a5

View file

@ -17,13 +17,14 @@ QtObject {
property string info: "" property string info: ""
// whether the lockscreen was passwordless // whether the lockscreen was passwordless
property bool passwordless: true property bool passwordless: false // TODO true
signal reset() signal reset()
signal unlockSucceeded() signal unlockSucceeded()
signal unlockFailed() signal unlockFailed()
function tryPassword() { function tryPassword() {
console.log('try')
if (root.password !== '') { // prevent typing lock when password is empty if (root.password !== '') { // prevent typing lock when password is empty
waitingForAuth = true; waitingForAuth = true;
} }
@ -39,7 +40,9 @@ QtObject {
Component.onCompleted: { Component.onCompleted: {
// determine whether we have passwordless login // determine whether we have passwordless login
// if we do, authenticator will emit a success signal, otherwise it will emit failure // if we do, authenticator will emit a success signal, otherwise it will emit failure
authenticator.tryUnlock();
// TODO: Disabled for the time being, since it seems to cause an infinite loop
// authenticator.tryUnlock();
} }
property var connections: Connections { property var connections: Connections {
@ -58,7 +61,7 @@ QtObject {
} }
function onFailed() { function onFailed() {
root.passwordless = false; // root.passwordless = false;
if (hasPrompt) { if (hasPrompt) {
console.log('login failed'); console.log('login failed');
root.waitingForAuth = false; root.waitingForAuth = false;
@ -84,8 +87,10 @@ QtObject {
function onPromptForSecret(msg) { function onPromptForSecret(msg) {
console.log('prompt secret: ' + msg); console.log('prompt secret: ' + msg);
authenticator.respond(root.password); if (root.password !== "") {
authenticator.tryUnlock(); authenticator.respond(root.password);
authenticator.tryUnlock();
}
} }
} }