Completed
Pull Request — master (#80)
by
unknown
03:25
created

Controller   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A redirectAll() 0 4 1
A handleCallbackAll() 0 8 1
1
<?php
2
3
namespace App\Containers\SocialAuth\UI\Web\Controllers;
4
5
use App\Port\Controller\Abstracts\PortWebController;
6
use Laravel\Socialite\Facades\Socialite;
7
8
/**
9
 * Class Controller
10
 *
11
 * @author  Mahmoud Zalt  <[email protected]>
12
 */
13
class Controller extends PortWebController
14
{
15
16
    /**
17
     * @param $provider
18
     *
19
     * @return  mixed
20
     */
21
    public function redirectAll($provider)
22
    {
23
        return Socialite::driver($provider)->redirect();
24
    }
25
26
    /**
27
     * @param $provider
28
     *
29
     * @return  mixed
30
     */
31
    public function handleCallbackAll($provider)
32
    {
33
        $user = Socialite::driver($provider)->user();
34
35
        // TODO: to be continue.. (move the codes to action), add business logic (store/update User)..
36
37
        dd($user);
38
    }
39
40
}
41