Skip to content

Commit

Permalink
Fix renew for service account access token logins
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Avery committed Apr 9, 2024
1 parent 4a339a9 commit 21e50cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/bitwarden/src/auth/renew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub(crate) async fn renew_token(client: &mut Client) -> Result<()> {
.await?;

if let (
IdentityTokenResponse::Authenticated(r),
IdentityTokenResponse::Payload(r),

Check warning on line 60 in crates/bitwarden/src/auth/renew.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden/src/auth/renew.rs#L60

Added line #L60 was not covered by tests
Some(state_file),
Ok(enc_settings),
) = (&result, state_file, client.get_encryption_settings())
Expand All @@ -83,6 +83,10 @@ pub(crate) async fn renew_token(client: &mut Client) -> Result<()> {
client.set_tokens(r.access_token, r.refresh_token, r.expires_in);
return Ok(());
}
IdentityTokenResponse::Payload(r) => {
client.set_tokens(r.access_token, r.refresh_token, r.expires_in);
return Ok(());

Check warning on line 88 in crates/bitwarden/src/auth/renew.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden/src/auth/renew.rs#L86-L88

Added lines #L86 - L88 were not covered by tests
}
_ => {
// We should never get here
return Err(Error::InvalidResponse);
Expand Down

0 comments on commit 21e50cc

Please sign in to comment.