SocialAuthController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
c 2
b 0
f 1
lcom 0
cbo 3
dl 0
loc 16
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A redirect() 0 4 1
A callback() 0 8 1
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
7
use App\Http\Requests;
8
use App\SocialAccountService;
9
use Laravel\Socialite\Facades\Socialite;
10
11
class SocialAuthController extends Controller
12
{
13
    public function  redirect() {
14
        return Socialite::driver('facebook')->redirect();
15
16
    }
17
18
    public function callback(SocialAccountService $service)
19
        {
20
            $user = $service->createOrGetUser(Socialite::driver('facebook')->user());
21
22
            auth()->login($user);
0 ignored issues
show
Bug introduced by
The method login() does not seem to exist on object<Illuminate\Contracts\Auth\Factory>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
24
            return redirect()->to('/');
25
        }
26
}
27