From 9e505bd2bbcfee0d0d6b78fe22d829bbb6683889 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sat, 23 Jan 2021 17:10:43 -0800 Subject: [PATCH] extract_uid for more legibility when we need to pull 'id' from user parameters --- server-api/src/http.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server-api/src/http.rs b/server-api/src/http.rs index f296771..924db17 100644 --- a/server-api/src/http.rs +++ b/server-api/src/http.rs @@ -27,4 +27,11 @@ pub async fn parse_json_params(body_raw: &mut Body) -> Result u64 { + // pulling 'id' from user params is safe because the + // auth modules guarantees this to be there already + values.get("id").unwrap().as_u64().unwrap() } \ No newline at end of file