Page 1 of 1

Security question

Posted: 2025-01-31 14:08
by lramirez
Hello good morning... Could it be possible to ask for an answer to a security question, right after logging in with the username and password? Only the first time you log in?
I wanted to know if that would be possible in Appgini?
Thanks

Re: Security question

Posted: 2025-01-31 16:51
by pbottcher
Hi Luis,

indeed you should be able to do so. After the login (in the __global.php -> login_ok) < you could check if the logged in user has not yet answered to a security question (this can be done by having a table to store all logins that already answered the question). If not answered, redirect the user to a page with a security question. Otherwise just continue.

On the security question page, upon successful completion, add this user to the table that you created to log all successful users that answered the security question .

Hope that gives a starting point.

Re: Security question

Posted: 2025-01-31 17:10
by jsetzer
That's a perfect answer, @pböttcher!

I'd kindly like to add, AppGini provides PHP-functions getUserData() and setUserData() which allow us to store and retrieve user dependent settings without additional tables.

Anyway, it depends on your requirements if an additional table makes sense and could be used for more user specific configuration options or so.

If this was only that one setting (or only a couple of), personally I would go with getUserData() / setUserData().

Just my 2 ¢