Pass keys around better

This commit is contained in:
Garth Vander Houwen 2024-08-18 11:39:41 -07:00
parent 9b50626ebe
commit aad3bd4f89
3 changed files with 3 additions and 4 deletions

View file

@ -58,7 +58,7 @@ extension NodeInfoEntity {
}
return false
}
var canRemoteAdmin: Bool {
if !(securityConfig?.adminKey?.isEmpty ?? true) {
return true

View file

@ -133,7 +133,6 @@ struct NetworkConfig: View {
}
.onChange(of: wifiSsid) { newSSID in
if newSSID != node?.networkConfig?.wifiSsid { hasChanges = true }
}
.onChange(of: wifiPsk) { newPsk in
if newPsk != node?.networkConfig?.wifiPsk { hasChanges = true }

View file

@ -132,8 +132,8 @@ struct SecurityConfig: View {
}
var config = Config.SecurityConfig()
//config.publicKey = publicKey
//config.privateKey = privateKey
config.publicKey = Data(base64Encoded: publicKey) ?? Data()
config.privateKey = Data(base64Encoded: privateKey) ?? Data()
config.adminKey = Data(base64Encoded: adminKey) ?? Data()
config.isManaged = isManaged
config.serialEnabled = serialEnabled