Created
May 26, 2015 00:04
-
-
Save erikfig/6328c284f48f03972578 to your computer and use it in GitHub Desktop.
CakePHP 3 Auth personalizado
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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