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 1/2] 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)] From 08afc312c392fefba2088eb5910e6b985afb5daf Mon Sep 17 00:00:00 2001 From: theycallmesteve <59837464+theycallmesteve@users.noreply.github.com> Date: Fri, 8 May 2020 13:39:17 -0400 Subject: [PATCH 2/2] Add missing items to profileOrganization response model --- src/db/models/organization.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/db/models/organization.rs b/src/db/models/organization.rs index 4ff0c56b..58fb9231 100644 --- a/src/db/models/organization.rs +++ b/src/db/models/organization.rs @@ -274,6 +274,8 @@ impl UserOrganization { "UseGroups": false, "UseTotp": true, "UsePolicies": true, + "UseApi": false, + "SelfHost": true, "MaxStorageGb": 10, // The value doesn't matter, we don't check server-side