You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Basic Authentication and Authorization example #161
With the help from lovasoa, i build my page so with authentification and restriction acces :
`SELECT 'redirect' AS component,
'signin.sql?error' AS link
WHERE NOT EXISTS (SELECT 1 FROM login_session WHERE id=sqlpage.cookie('session'));
SET group_id = (SELECT user_info.groupe FROM login_session join user_info on user_info.username=login_session.username WHERE id = sqlpage.cookie('session'));
SELECT 'redirect' AS component,
'index.sql?restriction' AS link
WHERE $group_id<'2';`
Hi @DSMejantel
Impressive example, thank you. I have a lot of things to learn from it. My example is only about Authentication and Authorization and reducing code duplication on every page.
Hello,
I propose a new version with my last commit for the authencation with an 'activation key' at the first time.
Then key is deleted when user has created his own password.
If password is lost, Admin can edit a new key and the forgotten password will be deleted.
So it will be easier to import vie csv file a lot of user with different key (and no more hash_password)
Activity
DSMejantel commentedon Dec 29, 2023
Hello,
You can see my example on my github repository.
With the help from lovasoa, i build my page so with authentification and restriction acces :
`SELECT 'redirect' AS component,
'signin.sql?error' AS link
WHERE NOT EXISTS (SELECT 1 FROM login_session WHERE id=sqlpage.cookie('session'));
SET group_id = (SELECT user_info.groupe FROM login_session join user_info on user_info.username=login_session.username WHERE id = sqlpage.cookie('session'));
SELECT 'redirect' AS component,
'index.sql?restriction' AS link
WHERE $group_id<'2';`
lovasoa commentedon Dec 29, 2023
I will add links to both your examples to the readme
mnesarco commentedon Dec 29, 2023
Hi @DSMejantel
Impressive example, thank you. I have a lot of things to learn from it. My example is only about Authentication and Authorization and reducing code duplication on every page.
DSMejantel commentedon Jan 8, 2024
Hello,
I propose a new version with my last commit for the authencation with an 'activation key' at the first time.
Then key is deleted when user has created his own password.
If password is lost, Admin can edit a new key and the forgotten password will be deleted.
So it will be easier to import vie csv file a lot of user with different key (and no more hash_password)