summaryrefslogtreecommitdiff
path: root/sql/functions/auth.update_password.sql
diff options
context:
space:
mode:
authorckonstanski <kostcarl@isu.edu>2026-07-18 21:18:18 -0600
committerckonstanski <kostcarl@isu.edu>2026-07-18 21:18:18 -0600
commit08e435104c42751689553537b1f20ffb14b8dfcc (patch)
treef83d8db1a02d4be448ab044d28fda7411470bd7c /sql/functions/auth.update_password.sql
initial commit
Diffstat (limited to 'sql/functions/auth.update_password.sql')
-rw-r--r--sql/functions/auth.update_password.sql19
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/functions/auth.update_password.sql b/sql/functions/auth.update_password.sql
new file mode 100644
index 0000000..8dc730c
--- /dev/null
+++ b/sql/functions/auth.update_password.sql
@@ -0,0 +1,19 @@
+drop function auth.update_password (
+ p_id bigint,
+ p_pwd character varying
+);
+
+create or replace function auth.update_password (
+ p_id bigint,
+ p_pwd character varying
+)
+returns bigint
+as $$
+begin
+ update auth.users
+ set pwd = digest(p_pwd, 'sha512')
+ where id = p_id;
+
+ return p_id;
+end;
+$$ language plpgsql;