refactoring: securize find_user_by_*
This commit is contained in:
@@ -3,7 +3,7 @@ $$
|
|||||||
declare
|
declare
|
||||||
_id alias for id;
|
_id alias for id;
|
||||||
begin
|
begin
|
||||||
select to_json(u) into resource
|
select to_jsonb(u) - 'password' into resource
|
||||||
from "user" as u
|
from "user" as u
|
||||||
where u.id = _id;
|
where u.id = _id;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ $$
|
|||||||
declare
|
declare
|
||||||
_username alias for username;
|
_username alias for username;
|
||||||
begin
|
begin
|
||||||
select to_json(u) into resource
|
select to_jsonb(u) - 'password' into resource
|
||||||
from "user" as u
|
from "user" as u
|
||||||
where u.username = _username;
|
where u.username = _username;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Reference in New Issue
Block a user