From 3e72d915e6f619b987e8527bdf8a5f01aedd799f Mon Sep 17 00:00:00 2001 From: Kai Jan Kriegel Date: Fri, 24 Feb 2023 21:29:22 +0100 Subject: [PATCH] switch tokenlist to uuids --- bffhd/capnp/user.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) 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(()) }