Browse Source

Empty AccountKeys when no private key (#6761)

Co-authored-by: Timshel <timshel@users.noreply.github.com>
pull/6202/head
Timshel 3 months ago
committed by Ross Golder
parent
commit
f8e2367c8c
  1. 20
      src/api/identity.rs

20
src/api/identity.rs

@ -487,14 +487,18 @@ async fn authenticated_response(
Value::Null
};
let account_keys = json!({
"publicKeyEncryptionKeyPair": {
"wrappedPrivateKey": user.private_key,
"publicKey": user.public_key,
"Object": "publicKeyEncryptionKeyPair"
},
"Object": "privateKeys"
});
let account_keys = if user.private_key.is_some() {
json!({
"publicKeyEncryptionKeyPair": {
"wrappedPrivateKey": user.private_key,
"publicKey": user.public_key,
"Object": "publicKeyEncryptionKeyPair"
},
"Object": "privateKeys"
})
} else {
Value::Null
};
let mut result = json!({
"access_token": auth_tokens.access_token(),

Loading…
Cancel
Save