Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Authenticate   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 21
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 11 4
1
<?php
2
3
namespace App\Http\Middleware;
4
5
use Closure;
6
use Illuminate\Support\Facades\Auth;
7
8
class Authenticate
9
{
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param  \Illuminate\Http\Request  $request
14
     * @param  \Closure  $next
15
     * @param  string|null  $guard
16
     * @return mixed
17
     */
18
    public function handle($request, Closure $next, $guard = null)
19
    {
20
        if (Auth::guard($guard)->guest()) {
21
            if ($request->ajax() || $request->wantsJson()) {
22
                return response('Unauthorized.', 401);
23
            } else {
24
                return redirect()->route('login');
25
            }
26
        }
27
28
        return $next($request);
29
    }
30
}
31