Skip to content

Bug: Missing loading helper 'auth' in ActionController #352

@MitkoIT

Description

@MitkoIT

PHP Version

7.4.16

CodeIgniter4 Version

4.2.3

Shield Version

v1.0.0-beta.2

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

mysqlnd 8.1.1

Did you customize Shield?

No

What happened?

We've wanted to enable 2FA authentication in our application, but after enabling it in Auth.php an error occurs.

Steps to Reproduce

Enable 2FA in Auth.php with this code
public array $actions = [ 'login' => 'CodeIgniter\Shield\Authentication\Actions\Email2FA', 'register' => null, ];

After user login, system is returning error
image

After some reading of Shield code we've seen that the ActionController actually don't load an auth helper. So that's why Codeigniter is trying to run auth() controller, what we see on the screenshot.

Please update ActionController and change
protected $helpers = ['setting']; to protected $helpers = ['auth', 'setting'];

Expected Output

image

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions