Skip to content
Snippets Groups Projects
Unverified Commit a40434d4 authored by Kali Kaneko's avatar Kali Kaneko
Browse files

[feat] do not show password field if allowEmptyPass is set

parent 6ba46743
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ Dialog { ...@@ -18,6 +18,7 @@ Dialog {
id: password id: password
placeholderText: qsTr("password") placeholderText: qsTr("password")
echoMode: TextInput.PasswordEchoOnEdit echoMode: TextInput.PasswordEchoOnEdit
visible: !allowEmptyPass
} }
} }
......
...@@ -11,6 +11,7 @@ ApplicationWindow { ...@@ -11,6 +11,7 @@ ApplicationWindow {
property var ctx property var ctx
property var loginDone property var loginDone
property var allowEmptyPass
Connections { Connections {
target: jsonModel target: jsonModel
...@@ -46,8 +47,20 @@ ApplicationWindow { ...@@ -46,8 +47,20 @@ ApplicationWindow {
} }
function showInitFailure(msg) { function showInitFailure(msg) {
initFailure.text = msg initFailure.text = msg
initFailure.visible = true initFailure.visible = true
}
function shouldAllowEmptyPass() {
let obj = JSON.parse(providers.getJson())
let active = obj['default']
let allProviders = obj['providers']
for (let i = 0; i < allProviders.length; i++) {
if (allProviders[i]['name'] === active) {
return (allProviders[i]['authEmptyPass'] === 'true')
}
}
return false
} }
Component.onCompleted: { Component.onCompleted: {
...@@ -59,9 +72,11 @@ ApplicationWindow { ...@@ -59,9 +72,11 @@ ApplicationWindow {
Loaders as a placeholder for all the many dialogs, or to load Loaders as a placeholder for all the many dialogs, or to load
a nice splash screen etc... */ a nice splash screen etc... */
console.debug("Pre-seeded providers:"); console.debug("DEBUG: Pre-seeded providers:");
console.debug(providers.getJson()); console.debug(providers.getJson());
allowEmptyPass = shouldAllowEmptyPass()
app.visible = true; app.visible = true;
show(); show();
hide(); hide();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment