• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

daycry / auth / 22527658769

28 Feb 2026 07:41PM UTC coverage: 63.267% (-3.6%) from 66.864%
22527658769

push

github

web-flow
Merge pull request #36 from daycry/development

Implement TOTP 2FA, JWT auth, device session tracking, and docs overhaul

465 of 1168 new or added lines in 52 files covered. (39.81%)

129 existing lines in 46 files now uncovered.

3064 of 4843 relevant lines covered (63.27%)

41.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Controllers/ActionController.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of Daycry Auth.
7
 *
8
 * (c) Daycry <daycry9@proton.me>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace Daycry\Auth\Controllers;
15

16
use CodeIgniter\Exceptions\PageNotFoundException;
17
use CodeIgniter\HTTP\Response;
18
use Daycry\Auth\Interfaces\ActionInterface;
19

20
/**
21
 * Class ActionController
22
 *
23
 * A generic controller to handle Authentication Actions.
24
 */
25
class ActionController extends BaseAuthController
26
{
27
    protected ?ActionInterface $action = null;
28

29
    /**
30
     * Perform an initial check if we have a valid action or not.
31
     *
32
     * @param list<string> $params
33
     *
34
     * @return Response|string
35
     */
UNCOV
36
    public function _remap(string $method, ...$params)
×
37
    {
38
        $authenticator = $this->getSessionAuthenticator();
×
39

40
        // Grab our action instance if one has been set.
41
        $this->action = $authenticator->getAction();
×
42

NEW
43
        if (! $this->action instanceof ActionInterface) {
×
44
            throw new PageNotFoundException();
×
45
        }
46

47
        return $this->{$method}(...$params);
×
48
    }
49

50
    /**
51
     * Shows the initial screen to the user to start the flow.
52
     * This might be asking for the user's email to reset a password,
53
     * or asking for a cell-number for a 2FA.
54
     *
55
     * @return Response|string
56
     */
UNCOV
57
    public function show()
×
58
    {
59
        return $this->action->show();
×
60
    }
61

62
    /**
63
     * Processes the form that was displayed in the previous form.
64
     *
65
     * @return Response|string
66
     */
UNCOV
67
    public function handle()
×
68
    {
69
        return $this->action->handle($this->request);
×
70
    }
71

72
    /**
73
     * This handles the response after the user takes action
74
     * in response to the show/handle flow. This might be
75
     * from clicking the 'confirm my email' action or
76
     * following entering a code sent in an SMS.
77
     *
78
     * @return Response|string
79
     */
UNCOV
80
    public function verify()
×
81
    {
82
        return $this->action->verify($this->request);
×
83
    }
84

85
    /**
86
     * ActionController doesn't use validation rules directly
87
     * as it delegates to action objects
88
     */
UNCOV
89
    protected function getValidationRules(): array
×
90
    {
91
        return [];
×
92
    }
93
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc