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.

AuthMiddleware::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
3
namespace Serverfireteam\Panel\libs;
4
5
use Lang;
6
use Closure;
7
8
class AuthMiddleware
9
{
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param  \Illuminate\Http\Request  $request
14
     * @param  \Closure  $next
15
     * @return mixed
16
     */
17
    public function handle($request, Closure $next)
18
    {
19
20
        if (is_null(\Auth::guard('panel')->user())) {
21
            $message = session('message', Lang::get('panel::fields.enterEmail'));
22
23
            return redirect('/panel/login')
24
                ->with('message', $message)
25
                ->with('mesType', 'message');
26
        }
27
28
        return $next($request);
29
    }
30
}
31