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.

LoginController   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 61
rs 10
c 0
b 0
f 0
wmc 7
lcom 0
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 4
A showLoginForm() 0 5 1
A logout() 0 7 1
A credentials() 0 4 1
1
<?php
2
namespace Afrittella\BackProject\Http\Controllers\Auth;
3
4
//use Afrittella\BackProject\app\Http\Controllers\Controller;
5
use App\Http\Controllers\Controller;
6
use Illuminate\Foundation\Auth\AuthenticatesUsers;
7
use Illuminate\Http\Request;
8
9
class LoginController extends Controller
10
{
11
12
    use AuthenticatesUsers {
13
        logout as defaultLogout;
14
    }
15
16
    public function __construct()
17
    {
18
        $this->middleware('guest', ['except' => 'logout']);
19
        // ----------------------------------
20
        // Use the admin prefix in all routes
21
        // If not logged in redirect here.
22
        $this->loginPath = property_exists($this, 'loginPath') ? $this->loginPath
23
          : config('back-project.route_prefix', 'admin').'/login';
24
        // Redirect here after successful login.
25
        $this->redirectTo = property_exists($this, 'redirectTo') ? $this->redirectTo
26
          : config('back-project.route_prefix', 'admin').'/dashboard';
27
        // Redirect here after logout.
28
        $this->redirectAfterLogout = property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout
29
          : '/';
30
        // ----------------------------------
31
    }
32
33
    /**
34
     * Show the application login form.
35
     *
36
     * @return \Illuminate\Http\Response
37
     */
38
    public function showLoginForm()
39
    {
40
        $this->data['title'] = trans('back-project::base.login'); // set the page title
41
        return view('back-project::auth.login', $this->data);
42
    }
43
44
    /**
45
     * Log the user out and redirect him to specific location.
46
     *
47
     * @param \Illuminate\Http\Request $request
48
     *
49
     * @return \Illuminate\Http\Response
50
     */
51
    public function logout(Request $request)
52
    {
53
        // Do the default logout procedure
54
        $this->defaultLogout($request);
55
        // And redirect to custom location
56
        return redirect($this->redirectAfterLogout);
57
    }
58
59
    /**
60
     * Get the needed authorization credentials from the request.
61
     *
62
     * @param  \Illuminate\Http\Request  $request
63
     * @return array
64
     */
65
    protected function credentials(Request $request)
66
    {
67
        return array_merge($request->only($this->username(), 'password'), ['confirmed' => 1, 'is_social' => 0]);
68
    }
69
}
70