I'm trying to use this plugin with the official authentication plugin, but I'm doing something wrong. I tried following the suggestion in the readme by adding:
use Muffin\Footprint\Auth\FootprintAwareTrait;
class AppController extends Controller
{
use FootprintAwareTrait {
_setCurrentUser as _footprintSetCurrentUser;
}
protected function _setCurrentUser($user = null)
{
if (!$user) {
$user = $this->request->getAttribute('identity');
}
return $this->_footprintSetCurrentUser($user);
}
}
to my AppController, but I get a TypeError Argument 1 passed to Cake\ORM\Marshaller::one() must be of the type array, object given, called in /app/vendor/cakephp/cakephp/src/ORM/Table.php on line 2630
calling $user->toArray() doesn't work, with a Call to undefined method Authentication\Identity::toArray() error.
wrapping the [$user] object in an array resolves errors, but doesn't actually save created_by/modified_by fields in the database.
I'm trying to use this plugin with the official authentication plugin, but I'm doing something wrong. I tried following the suggestion in the readme by adding:
to my
AppController
, but I get a TypeErrorArgument 1 passed to Cake\ORM\Marshaller::one() must be of the type array, object given, called in /app/vendor/cakephp/cakephp/src/ORM/Table.php on line 2630
calling
$user->toArray()
doesn't work, with aCall to undefined method Authentication\Identity::toArray()
error.wrapping the
[$user]
object in an array resolves errors, but doesn't actually save created_by/modified_by fields in the database.