From 21e50ccc49a38a4e28ba7b409fa34d554c945cf0 Mon Sep 17 00:00:00 2001 From: Thomas Avery Date: Tue, 9 Apr 2024 17:08:08 -0500 Subject: [PATCH] Fix renew for service account access token logins --- crates/bitwarden/src/auth/renew.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/bitwarden/src/auth/renew.rs b/crates/bitwarden/src/auth/renew.rs index 6f93f7482..98c812a08 100644 --- a/crates/bitwarden/src/auth/renew.rs +++ b/crates/bitwarden/src/auth/renew.rs @@ -57,7 +57,7 @@ pub(crate) async fn renew_token(client: &mut Client) -> Result<()> { .await?; if let ( - IdentityTokenResponse::Authenticated(r), + IdentityTokenResponse::Payload(r), Some(state_file), Ok(enc_settings), ) = (&result, state_file, client.get_encryption_settings()) @@ -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(()); + } _ => { // We should never get here return Err(Error::InvalidResponse);