-2
I am using a table named ga_usuario for access management, I generated the skeleton with Bake in cakephp and the controller became Gausuariocontroller, the problem is that when I log in it says that the users table does not exist, the question is, how can I set userModel to my model ?
My apllication.php has the following function for authentication:
public function getAuthenticationService(ServerRequestInterface $request): AuthenticationServiceInterface
{
$service = new AuthenticationService();
$service->setConfig([
'unauthenticatedRedirect' => '/cake-erp/GaUsuario/login',
'queryParam' => 'redirect',
]);
$fields = [
'username' => 'usuario',
'password' => 'senha'
];
// Load the authenticators, you want session first
$service->loadAuthenticator('Authentication.Session');
$service->loadAuthenticator('Authentication.Form', [
'fields' => $fields,
'loginUrl' => '/cake-erp/GaUsuario/login'
]);
// Load identifiers
$service->loadIdentifier('Authentication.Password', compact('fields'));
return $service;
}
Even adding the 'Usermodel' => 'Gausuario' it does not identify and keeps giving error, see the error below