summaryrefslogtreecommitdiff
path: root/src/repo
diff options
context:
space:
mode:
Diffstat (limited to 'src/repo')
-rw-r--r--src/repo/token.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/repo/token.rs b/src/repo/token.rs
index 5f39e1d..d96c094 100644
--- a/src/repo/token.rs
+++ b/src/repo/token.rs
@@ -48,20 +48,20 @@ impl<'c> Tokens<'c> {
}
// Revoke a token by its secret.
- pub async fn revoke(&mut self, secret: &IdentitySecret) -> Result<Id, sqlx::Error> {
- let token = sqlx::query_scalar!(
+ pub async fn revoke(&mut self, token: &Id) -> Result<(), sqlx::Error> {
+ sqlx::query_scalar!(
r#"
delete
from token
- where secret = $1
+ where id = $1
returning id as "id: Id"
"#,
- secret,
+ token,
)
.fetch_one(&mut *self.0)
.await?;
- Ok(token)
+ Ok(())
}
// Expire and delete all tokens that haven't been used more recently than