moltbook_cli/cli/
verification.rs1use colored::Colorize;
8
9pub fn handle_verification(result: &serde_json::Value, action: &str) -> bool {
13 if let Some(true) = result["verification_required"].as_bool() {
14 if let Some(verification) = result.get("verification") {
15 let instructions = verification["instructions"].as_str().unwrap_or("");
16 let challenge = verification["challenge"].as_str().unwrap_or("");
17 let code = verification["code"].as_str().unwrap_or("");
18
19 println!("\n{}", "🔒 Verification Required".yellow().bold());
20 println!("{}", instructions);
21 println!("Challenge: {}\n", challenge.cyan().bold());
22 println!("To complete your {}, run:", action);
23 println!(
24 " moltbook verify --code \"{}\" --solution \"<YOUR_ANSWER>\"",
25 code
26 );
27 return true;
28 }
29 }
30 false
31}