mirror of
https://github.com/BetterCorp/BetterFrame.git
synced 2026-05-26 16:56:33 +00:00
fix(kiosk): accept integer kiosk_id in claim response
Server returns kiosk_id as integer (not yet migrated to UUIDv7). ClaimResp.kiosk_id changed from Option<String> to Option<Value> to handle both integer and string. This was causing a panic on deserialization after successful pairing. Also simplified Coolify version arg. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cefd378b67
commit
bc7b7695d8
1 changed files with 7 additions and 2 deletions
|
|
@ -300,7 +300,7 @@ fn encrypt_key_file() -> PathBuf {
|
|||
#[derive(Deserialize)]
|
||||
struct ClaimResp {
|
||||
status: String,
|
||||
kiosk_id: Option<String>,
|
||||
kiosk_id: Option<serde_json::Value>,
|
||||
kiosk_key: Option<String>,
|
||||
kiosk_name: Option<String>,
|
||||
cluster_key: Option<String>,
|
||||
|
|
@ -329,7 +329,12 @@ pub fn poll_claim(server: &str, code: &str) -> (String, String) {
|
|||
let key = claim.kiosk_key.expect("missing kiosk_key");
|
||||
let name = claim.kiosk_name.unwrap_or_else(|| "kiosk".into());
|
||||
if let Some(ref id) = claim.kiosk_id {
|
||||
crate::axiom::set_kiosk_id(id.clone());
|
||||
let id_str = match id {
|
||||
serde_json::Value::String(s) => s.clone(),
|
||||
serde_json::Value::Number(n) => n.to_string(),
|
||||
other => other.to_string(),
|
||||
};
|
||||
crate::axiom::set_kiosk_id(id_str);
|
||||
}
|
||||
crate::at_rest::write_encrypted(&key_file(), key.as_bytes())
|
||||
.expect("failed to save kiosk key");
|
||||
|
|
|
|||
Loading…
Reference in a new issue