From 5571a5d8ed54c546e86b5d24108351c640c5b86c Mon Sep 17 00:00:00 2001 From: theycallmesteve <59837464+theycallmesteve@users.noreply.github.com> Date: Fri, 8 May 2020 13:38:49 -0400 Subject: [PATCH] Update post_keys to return a keys response model --- src/api/core/accounts.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs index 13f3e810..1c487da3 100644 --- a/src/api/core/accounts.rs +++ b/src/api/core/accounts.rs @@ -210,7 +210,12 @@ fn post_keys(data: JsonUpcase, headers: Headers, conn: DbConn) -> Json user.public_key = Some(data.PublicKey); user.save(&conn)?; - Ok(Json(user.to_json(&conn))) + + Ok(Json(json!({ + "PrivateKey": user.private_key, + "PublicKey": user.public_key, + "Object":"keys" + }))) } #[derive(Deserialize)]