fix: getconfirmationcode query

This commit is contained in:
2025-07-02 14:09:10 +03:00
parent 96e41efdec
commit d08db300fc
2 changed files with 12 additions and 2 deletions

View File

@@ -231,7 +231,12 @@ func (q *Queries) DeleteUserByUsername(ctx context.Context, username string) err
const getConfirmationCodeByCode = `-- name: GetConfirmationCodeByCode :one
SELECT id, user_id, code_type, code_hash, expires_at, used, deleted FROM confirmation_codes
WHERE user_id = $1 AND code_type = $2 AND expires_at > CURRENT_TIMESTAMP AND code_hash = crypt($3::text, code_hash)
WHERE
user_id = $1 AND
code_type = $2 AND
expires_at > CURRENT_TIMESTAMP AND
used IS FALSE AND
code_hash = crypt($3::text, code_hash)
`
type GetConfirmationCodeByCodeParams struct {