Skip to content

Instantly share code, notes, and snippets.

@erikfig
Created May 26, 2015 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikfig/6328c284f48f03972578 to your computer and use it in GitHub Desktop.
Save erikfig/6328c284f48f03972578 to your computer and use it in GitHub Desktop.
CakePHP 3 Auth personalizado
public function initialize()
{
parent::initialize();
$this->loadComponent('Auth', [
'loginAction' => [
'controller' => 'Usuarios', //aqui eu troco o controller
'action' => 'acesso' //aqui a action que vamos usar pra logar
],
'authenticate' => [
'Form' => [
'fields' => ['username' => 'email', 'password' => 'senha'] // aqui eu troco os campos que quero usa
'userModel' => 'Usuarios' // aqui eu seto o model (Table)
]
]
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment