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

daycry / auth / 21003933517

14 Jan 2026 05:39PM UTC coverage: 66.786% (+0.2%) from 66.555%
21003933517

push

github

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

Add OAuth 2.0 support and improve authentication extensibility

201 of 278 new or added lines in 24 files covered. (72.3%)

7 existing lines in 4 files now uncovered.

2246 of 3363 relevant lines covered (66.79%)

33.3 hits per line

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

23.08
/src/Controllers/OauthController.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 Daycry\Auth\Libraries\Oauth\OauthManager;
17
use Exception;
18

19
class OauthController extends BaseAuthController
20
{
21
    protected $helpers = ['setting', 'url'];
22

23
    /**
24
     * Get rules for validation
25
     */
26
    protected function getValidationRules(): array
27
    {
NEW
28
        return [];
×
29
    }
30

31
    public function redirect(string $provider)
32
    {
33
        $config  = config('Auth');
1✔
34
        $manager = new OauthManager($config);
1✔
35

36
        return $manager->setProvider($provider)->redirect();
1✔
37
    }
38

39
    public function callback(string $provider)
40
    {
NEW
41
        $config  = config('Auth');
×
NEW
42
        $manager = new OauthManager($config);
×
43

44
        try {
NEW
45
            $user = $manager->setProvider($provider)->handleCallback(
×
NEW
46
                $this->request->getGet('code') ?? '',
×
NEW
47
                $this->request->getGet('state') ?? '',
×
NEW
48
            );
×
49

NEW
50
            return redirect()->to(config('Auth')->loginRedirect());
×
NEW
51
        } catch (Exception $e) {
×
NEW
52
            return redirect()->to(config('Auth')->loginPage())->with('error', $e->getMessage());
×
53
        }
54
    }
55
}
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