diff options
author | pennae <github@quasiparticle.net> | 2022-07-13 18:09:19 +0200 |
---|---|---|
committer | pennae <github@quasiparticle.net> | 2022-07-13 18:09:19 +0200 |
commit | d6da876cabe0180acd0ebca173d973c8d3450d99 (patch) | |
tree | d0a76d4c9a2e83d918e87258865f11ae2c4b49af /src/db | |
parent | d62d1be05ca16a4836ad66440fda477f4ed6817a (diff) | |
download | minor-skulk-d6da876cabe0180acd0ebca173d973c8d3450d99.tar.gz minor-skulk-d6da876cabe0180acd0ebca173d973c8d3450d99.tar.xz minor-skulk-d6da876cabe0180acd0ebca173d973c8d3450d99.zip |
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.
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/mod.rs | 7 |
1 files changed, 3 insertions, 4 deletions
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<bool> { + 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<()> { |