12 lines
183 B
MySQL
12 lines
183 B
MySQL
|
CREATE FUNCTION _api.get_user_id()
|
||
|
RETURNS INTEGER
|
||
|
LANGUAGE plpgsql VOLATILE
|
||
|
AS $BODY$
|
||
|
BEGIN
|
||
|
RETURN CURRENT_SETTING(
|
||
|
'request.jwt.claims',
|
||
|
TRUE
|
||
|
)::JSON->>'user_id';
|
||
|
END
|
||
|
$BODY$;
|