webhook tokens of tombstoned users rejected

This commit is contained in:
2026-10-26 03:17:00 +01:00
parent c9e74d9cc3
commit caab63596a
3 changed files with 66 additions and 3 deletions

View File

@@ -51,8 +51,9 @@ impl WebhookTokenRepository for SqliteWebhookTokenRepository {
async fn find_by_token_hash(&self, hash: &str) -> Result<Option<WebhookToken>, DomainError> {
let row = sqlx::query(
"SELECT id, user_id, token_hash, provider, label, created_at, last_used_at \
FROM webhook_tokens WHERE token_hash = ?",
"SELECT t.id, t.user_id, t.token_hash, t.provider, t.label, t.created_at, t.last_used_at \
FROM webhook_tokens t JOIN users u ON u.id = t.user_id \
WHERE t.token_hash = ? AND u.deleted_at IS NULL",
)
.bind(hash)
.fetch_optional(&self.pool)