From d6da876cabe0180acd0ebca173d973c8d3450d99 Mon Sep 17 00:00:00 2001 From: pennae Date: Wed, 13 Jul 2022 18:09:19 +0200 Subject: keep oauth tokens around a bit after expiry firefox wants to delete profile access tokens after they're expired and logs errors if it can't do that. since this happens every hour we can end up with a bunch of error logs very quickly, so we better let it do what it wants. --- src/db/mod.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/db') diff --git a/src/db/mod.rs b/src/db/mod.rs index 040507f..fa2b62f 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -559,11 +559,10 @@ impl DbConn { Ok(()) } - pub(crate) async fn delete_oauth_token(&self, id: &OauthTokenID) -> sqlx::Result<()> { - query!(r#"delete from oauth_token where id = $1"#, id as _) + pub(crate) async fn delete_oauth_token(&self, id: &OauthTokenID) -> sqlx::Result { + Ok(query!(r#"delete from oauth_token where id = $1"#, id as _) .execute(&mut self.get().await?.tx) - .await?; - Ok(()) + .await?.rows_affected() > 0) } pub(crate) async fn delete_refresh_token(&self, id: &OauthTokenID) -> sqlx::Result<()> { -- cgit v1.2.3