Passed
Push — master ( 28a360...d194a0 )
by Mihail
11:20
created

User::actionEndpoint()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Apps\Controller\Api;
4
5
use Extend\Core\Arch\ApiController;
6
use Ffcms\Core\App;
7
use Ffcms\Core\Exception\JsonException;
8
9
class User extends ApiController
10
{
11
12
    /**
13
     * Check user auth.
14
     * @return string
15
     * @throws JsonException
16
     */
17
    public function actionAuth()
18
    {
19
        if (!App::$User->isAuth()) {
20
            throw new JsonException('No auth');
21
        }
22
23
        return json_encode([
24
            'status' => 1,
25
            'data' => 'Auth done'
26
        ]);
27
    }
28
29
    /**
30
     * Hybridauth endpoint.
31
     */
32
    public function actionEndpoint()
33
    {
34
        \Hybrid_Endpoint::process();
35
    }
36
37
}