From 8581ebb5582fdcb93b3e73a366c1e30e64b05ecd Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Fri, 26 Jul 2019 16:27:46 +0200 Subject: [PATCH] refactoring: securize find_user_by_* --- resources/functions/user/find_user_by_id.sql | 2 +- resources/functions/user/find_user_by_username.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/functions/user/find_user_by_id.sql b/resources/functions/user/find_user_by_id.sql index 9833093..0e2a5d1 100644 --- a/resources/functions/user/find_user_by_id.sql +++ b/resources/functions/user/find_user_by_id.sql @@ -3,7 +3,7 @@ $$ declare _id alias for id; begin - select to_json(u) into resource + select to_jsonb(u) - 'password' into resource from "user" as u where u.id = _id; end; diff --git a/resources/functions/user/find_user_by_username.sql b/resources/functions/user/find_user_by_username.sql index 717a643..60ab0d8 100644 --- a/resources/functions/user/find_user_by_username.sql +++ b/resources/functions/user/find_user_by_username.sql @@ -3,7 +3,7 @@ $$ declare _username alias for username; begin - select to_json(u) into resource + select to_jsonb(u) - 'password' into resource from "user" as u where u.username = _username; end;