SocialAuthController::redirect()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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