This may be a simple question but this is the first time I am dealing with the User_CustomValidate function and “Google Sing on”.
My “users” table has the following fields: “user”, “password”, “mail” and “userlevel”. I understand that if I use Google Sign on what comes back to me after a user is identified with his mail I get this a username.
PHP support tells me that the only thing I have to do is to map that email in the user table but I don’t know how to do it. I guess I would have to do something like this:
function User_CustomValidate(string &$userName): bool
{
if (IsAccessTokenUser()) {
$userName = ExecuteQuery("SELECT user FROM users WHERE email = '$userName"");
}
return false;
}
Basically, you only need on create the same userid,email that u login with SSO and grant the permission accordingly. Once authenticate, it should log you in automatically if the user existed in the system.