summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/login/repo/tokens.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/login/repo/tokens.rs b/src/login/repo/tokens.rs
index 4d381ef..ec95f6a 100644
--- a/src/login/repo/tokens.rs
+++ b/src/login/repo/tokens.rs
@@ -44,18 +44,18 @@ impl<'c> Tokens<'c> {
Ok(secret)
}
- /// Revoke a token by its secret. If there is no such token with that
- /// secret, this will succeed by doing nothing.
+ /// Revoke a token by its secret.
pub async fn revoke(&mut self, secret: &str) -> Result<(), sqlx::Error> {
sqlx::query!(
r#"
delete
from token
where secret = $1
+ returning 1 as "found: u32"
"#,
secret,
)
- .execute(&mut *self.0)
+ .fetch_one(&mut *self.0)
.await?;
Ok(())