webhook tokens of tombstoned users rejected
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user