CodeIgniter Forums
Shield Authentication Actions Customize - Printable Version

+- CodeIgniter Forums (
+-- Forum: CodeIgniter 4 (
+--- Forum: CodeIgniter 4 Addins (
+--- Thread: Shield Authentication Actions Customize (/showthread.php?tid=90522)

Shield Authentication Actions Customize - TakonSix - 03-30-2024

i am trying on a new composer install Codeigniter & Shield to include a new Authentication Action "activate by admin".
First i try to copy EmailActivator named it AdminActivator and delete the email part and the createCodeIdentity.
But i ended in a 404!
Then i try copy EmailActivator named it AdminActivator and delete the email part and add to show function
PHP Code:
and create the function
PHP Code:
private function deleteIdentity(User $user)
        /** @var UserIdentityModel $identityModel */
        $identityModel model(UserIdentityModel::class);
This works but!

Now i wanna make this secure for any updates of Shield. So i make some folder under App (Authentication/Actions) and place there my new AdminActivator.php
In App/Config/Auth.php 
PHP Code:
public array $actions = [
        'register' => \Authentication\Actions\AdminActivator::class,
        'login'    => null,
And voila i get this error 
Call to a member function createIdentity() on null
VENDORPATH/codeigniter4/shield/src/Authentication/Authenticators/Session.php at line 209

what am i missing?