update conflict resolution, in the right place, and with correct syntax (you didnt see the past 2 commits)

This commit is contained in:
slonkazoid 2024-12-29 22:49:55 +03:00
parent 1f86eafc8a
commit 44428162ca
Signed by: slonk
SSH key fingerprint: SHA256:tbZfJX4IOvZ0LGWOWu5Ijo8jfMPi78TU7x1VoEeCIjM

View file

@ -66,7 +66,7 @@ case "$action" in
hash=$(printf '%s' "$password" | argon2_hash)
echo "registering user $username" >&2
unset password
db_query "INSERT INTO users (username, password) VALUES ($(escape_sql_str "$username"), $(escape_sql_str "$hash")) ON CONFLICT (username) DO SET password=excluded.password" >&2
db_query "INSERT INTO users (username, password) VALUES ($(escape_sql_str "$username"), $(escape_sql_str "$hash")) ON CONFLICT (username) DO UPDATE SET password=excluded.password" >&2
created=true
else