refactor: manually renamed password fields

This commit is contained in:
2025-06-19 17:16:41 +03:00
parent 49534d46c1
commit 912470b6e2
2 changed files with 10 additions and 10 deletions

View File

@@ -76,11 +76,11 @@ WHERE users.username = $1;
;-- name: CreateLoginInformation :one
INSERT INTO login_informations(user_id, email, password_hash)
VALUES ( $1, $2, crypt($3, gen_salt('bf')) ) RETURNING *;
VALUES ( $1, $2, crypt(@password::text, gen_salt('bf')) ) RETURNING *;
;-- name: UpdateLoginInformationByUsername :exec
UPDATE login_informations
SET email = $2, password_hash = crypt($3, gen_salt('bf')), totp_encrypted = $4, email_2fa_enabled = $5, password_change_date = $6
SET email = $2, password_hash = crypt(@password::text, gen_salt('bf')), totp_encrypted = $4, email_2fa_enabled = $5, password_change_date = $6
FROM users
WHERE users.username = $1 AND login_informations.user_id = users.id;