We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d3c8dc commit c0a1911Copy full SHA for c0a1911
examples/user-authentication/protected_page.sql
@@ -1,6 +1,8 @@
1
SELECT 'redirect' AS component,
2
'signin.sql?error' AS link
3
WHERE logged_in_user(sqlpage.cookie('session')) IS NULL;
4
+-- logged_in_user is a custom postgres function defined in the first migration of this example
5
+-- that avoids having to repeat `(SELECT username FROM login_session WHERE id = session_id)` everywhere.
6
7
SELECT 'shell' AS component, 'Protected page' AS title, 'lock' AS icon, '/' AS link, 'logout' AS menu_item;
8
0 commit comments