From 90b584eaa2ce9ee210330d3fd22f8a4e8b13fdb1 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 25 Apr 2021 12:40:08 -0700 Subject: [PATCH] * Fixing /invites/join as it was returning the wrong struct data :facepalm: Secret value given to user was literally the encrypted secret because I forgot to rebind it - removing dev key lmaoooo These are generated super easily and this key doesn't actually go to anything so its really not a problem, although it is annoying that its there --- json-api/hmac.secret | 2 -- json-api/src/invites.rs | 9 ++++++--- 2 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 json-api/hmac.secret diff --git a/json-api/hmac.secret b/json-api/hmac.secret deleted file mode 100644 index 507cee7..0000000 --- a/json-api/hmac.secret +++ /dev/null @@ -1,2 +0,0 @@ -bC'BI%bj]H>$ bwY攘# -4O>'ɓ \ No newline at end of file diff --git a/json-api/src/invites.rs b/json-api/src/invites.rs index 77cc938..600918f 100644 --- a/json-api/src/invites.rs +++ b/json-api/src/invites.rs @@ -68,9 +68,12 @@ async fn use_invite(pool: &Pool, code: Option) -> Option{ let raw_secret = auth::generate_secret(); let secret = auth::encrypt_secret(&raw_secret).unwrap(); return match Member::add(pool, "Anonymous".into(), &secret, GENERAL_NEW).await { - Ok(response) => { - match response { - db::Response::Row(member) => Some(member), + Ok(dbresponse) => { + match dbresponse { + db::Response::Row(mut member) => { + member.secret = raw_secret; + Some(member) + } _ => None } },