diff --git a/bffhd/capnp/user.rs b/bffhd/capnp/user.rs index aaa63fa..0eb81c7 100644 --- a/bffhd/capnp/user.rs +++ b/bffhd/capnp/user.rs @@ -210,20 +210,13 @@ impl card_d_e_s_fire_e_v2::Server for User { "User API object with nonexisting user \"{}\"", self.user.get_username() )))); - let tk = user + if let Some(tk) = user .userdata .kv - .get("cardtoken") - .map(|ck| hex::decode(ck).ok()) - .flatten() - .unwrap_or_else(|| { - tracing::debug!(user.id = &user.id, "no tokens stored"); - Vec::new() - }); - if !tk.is_empty() { + .get("cardtoken") { let mut b = results.get(); let mut lb = b.init_token_list(1); - lb.set(0, &tk[..]); + lb.set(0, tk.as_ref()); } Promise::ok(()) }