correct query param number in delete_token (#380)

This commit is contained in:
sqwishy
2022-08-09 08:57:03 -07:00
committed by GitHub
parent 6690da06a9
commit 56e082b17c
2 changed files with 1194 additions and 1192 deletions
+1190 -1190
View File
File diff suppressed because it is too large Load Diff
+4 -2
View File
@@ -1425,8 +1425,10 @@ async fn delete_token(
error::Error::BadRequest(format!("Only users with email can create tokens"))
})?;
let tokens_deleted: Vec<String> = sqlx::query_scalar(
"DELETE FROM token WHERE email = $1 AND
token LIKE concat($3, '%') RETURNING concat(substring(token for 10), '*****')",
"DELETE FROM token
WHERE email = $1
AND token LIKE concat($2::text, '%')
RETURNING concat(substring(token for 10), '*****')",
)
.bind(&email)
.bind(&token_prefix)