add an explanation about the logged_in_user function

Hopefully it prevents users from introducing security vulnerabilities in their websites
This commit is contained in:
lovasoa
2023-11-06 23:22:33 +01:00
parent ec0e580a95
commit c5a56937b4
@@ -1,6 +1,8 @@
SELECT 'redirect' AS component,
'signin.sql?error' AS link
WHERE logged_in_user(sqlpage.cookie('session')) IS NULL;
-- logged_in_user is a custom postgres function defined in the first migration of this example
-- that avoids having to repeat `(SELECT username FROM login_session WHERE id = session_id)` everywhere.
SELECT 'shell' AS component, 'Protected page' AS title, 'lock' AS icon, '/' AS link, 'logout' AS menu_item;