• 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

70.0
/src/Filters/ForcePasswordResetFilter.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\Filters;
15

16
use CodeIgniter\Filters\FilterInterface;
17
use CodeIgniter\HTTP\IncomingRequest;
18
use CodeIgniter\HTTP\RedirectResponse;
19
use CodeIgniter\HTTP\RequestInterface;
20
use CodeIgniter\HTTP\ResponseInterface;
21
use Daycry\Auth\Authentication\Authenticators\Session;
22
use Daycry\Auth\Config\Auth;
23

24
/**
25
 * Force Password Reset Filter.
26
 */
27
class ForcePasswordResetFilter implements FilterInterface
28
{
29
    /**
30
     * Checks if a logged in user should reset their
31
     * password, and then redirect to the appropriate
32
     * page.
33
     *
34
     * @param array|null $arguments
35
     *
36
     * @return RedirectResponse|void
37
     */
38
    public function before(RequestInterface $request, $arguments = null)
1✔
39
    {
40
        if (! $request instanceof IncomingRequest) {
1✔
41
            return;
×
42
        }
43

44
        if (auth()->getAuthenticator() instanceof Session) {
1✔
45
            /** @var Session $authenticator */
46
            $authenticator = auth('session')->getAuthenticator();
1✔
47

48
            /** @var Auth $config */
49
            $config = config(Auth::class);
1✔
50

51
            if ($authenticator->loggedIn() && $authenticator->getUser()->requiresPasswordReset()) {
1✔
52
                return redirect()->to($config->forcePasswordResetRedirect());
1✔
53
            }
54
        }
55
    }
56

57
    /**
58
     * We don't have anything to do here.
59
     *
60
     * @param array|null $arguments
61
     */
UNCOV
62
    public function after(RequestInterface $request, ResponseInterface $response, $arguments = null): void
×
63
    {
64
    }
×
65
}
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