fix: getconfirmationcode query
This commit is contained in:
@@ -117,7 +117,12 @@ VALUES ($1, $2, crypt(@code::text, gen_salt('bf'))) RETURNING *;
|
||||
|
||||
;-- name: GetConfirmationCodeByCode :one
|
||||
SELECT * FROM confirmation_codes
|
||||
WHERE user_id = $1 AND code_type = $2 AND expires_at > CURRENT_TIMESTAMP AND code_hash = crypt(@code::text, code_hash);
|
||||
WHERE
|
||||
user_id = $1 AND
|
||||
code_type = $2 AND
|
||||
expires_at > CURRENT_TIMESTAMP AND
|
||||
used IS FALSE AND
|
||||
code_hash = crypt(@code::text, code_hash);
|
||||
|
||||
;-- name: UpdateConfirmationCode :exec
|
||||
UPDATE confirmation_codes
|
||||
|
||||
Reference in New Issue
Block a user