update conflict resolution

This commit is contained in:
slonkazoid 2024-12-29 22:46:55 +03:00
parent 5396934f66
commit 659ef11451
Signed by: slonk
SSH key fingerprint: SHA256:tbZfJX4IOvZ0LGWOWu5Ijo8jfMPi78TU7x1VoEeCIjM

View file

@ -60,7 +60,7 @@ case "$action" in
exit
fi
{
query="SELECT password FROM users WHERE username=$(escape_sql_str "$username")"
query="SELECT password FROM users WHERE username=$(escape_sql_str "$username") ON CONFLICT (username) DO SET password=excluded.password"
row=$(db_row "$query")
if [[ "$row" == "null" ]]; then
hash=$(printf '%s' "$password" | argon2_hash)