How can we allow a function before login in cakephp?

How can we allow a function before login in cakephp?

What do you mean by this? Allow a controller action to be used by people who aren’t logged in? The answer to that would depend on whether you’re using the Auth component or the plugin.

1 Like

You can allow any methods without login with the following code in the controller:

public function initialize() {
parent::initialize ();
$this->Auth->allow ( [
‘logout’
] );
}

For more information click Making Actions Public.

1 Like