GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

SocialLoginController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A redirectToProvider() 0 4 1
A handleProviderCallback() 0 14 2
1
<?php
2
namespace Afrittella\BackProject\Http\Controllers\Auth;
3
4
use Afrittella\BackProject\Repositories\Users;
5
use Socialite;
6
use Auth;
7
8
class SocialLoginController
9
{
10
    public function redirectToProvider($provider = 'facebook')
11
    {
12
        return Socialite::driver($provider)->redirect();
13
    }
14
15
    public function handleProviderCallback(Users $users, $provider = 'facebook')
16
    {
17
        try {
18
            $user = Socialite::driver($provider)->user();
19
        } catch (Exception $e) {
0 ignored issues
show
Bug introduced by
The class Afrittella\BackProject\H...trollers\Auth\Exception does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
20
            return redirect(route('bp.social_login', [$provider]));
21
        }
22
23
        $authUser = $users->createOrGetFromSocial($user, $provider);
24
25
        Auth::login($authUser, true);
26
27
        return redirect()->route(config('back-project.redirect_after_social_login'));
28
    }
29
}