Skip to content

Commit

Permalink
🎨
Browse files Browse the repository at this point in the history
  • Loading branch information
reckter committed Oct 5, 2022
1 parent 1a1a542 commit b7c228c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
7 changes: 2 additions & 5 deletions src/agent/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,8 @@ pub async fn sign_request(
payload.insert("type", "ssh".to_string());
payload.insert("data", base64_data);
payload.insert("userName", name);
match auto_accept_token {
None => {}
Some(token) => {
payload.insert("autoAcceptToken", token);
}
if let Some(token) = auto_accept_token {
payload.insert("autoAcceptToken", token);
}

match proxy {
Expand Down
22 changes: 9 additions & 13 deletions src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,15 @@ pub async fn sign_git_commit(armour_output: bool) -> Result<()> {
}
log.success("Accepted")?;

match response.auto_accept_token {
None => {}
Some(auto_accept_token) => match response.auto_accept_expires_at {
None => {}
Some(expires_at) => {
store_auto_accept(
"git".to_string(),
committer.to_string(),
auto_accept_token,
expires_at,
)?;
}
},
if let Some(auto_accept_token) = response.auto_accept_token {
if let Some(expires_at) = response.auto_accept_expires_at {
store_auto_accept(
"git".to_string(),
committer.to_string(),
auto_accept_token,
expires_at,
)?;
}
}

if let Some(data_base64) = response.signature {
Expand Down

0 comments on commit b7c228c

Please sign in to comment.