@@ -7,41 +7,41 @@ |
||
7 | 7 | |
8 | 8 | class Authenticate |
9 | 9 | { |
10 | - /** |
|
11 | - * The authentication guard factory instance. |
|
12 | - * |
|
13 | - * @var \Illuminate\Contracts\Auth\Factory |
|
14 | - */ |
|
15 | - protected $auth; |
|
10 | + /** |
|
11 | + * The authentication guard factory instance. |
|
12 | + * |
|
13 | + * @var \Illuminate\Contracts\Auth\Factory |
|
14 | + */ |
|
15 | + protected $auth; |
|
16 | 16 | |
17 | - /** |
|
18 | - * Create a new middleware instance. |
|
19 | - * |
|
20 | - * @param \Illuminate\Contracts\Auth\Factory $auth |
|
21 | - */ |
|
22 | - public function __construct(Auth $auth) |
|
23 | - { |
|
24 | - $this->auth = $auth; |
|
25 | - } |
|
17 | + /** |
|
18 | + * Create a new middleware instance. |
|
19 | + * |
|
20 | + * @param \Illuminate\Contracts\Auth\Factory $auth |
|
21 | + */ |
|
22 | + public function __construct(Auth $auth) |
|
23 | + { |
|
24 | + $this->auth = $auth; |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * Handle an incoming request. |
|
29 | - * |
|
30 | - * @param \Illuminate\Http\Request $request |
|
31 | - * @param \Closure $next |
|
32 | - * @param string|null $guard |
|
33 | - * @return mixed |
|
34 | - */ |
|
35 | - public function handle($request, Closure $next, $guard = null) |
|
36 | - { |
|
37 | - if ($this->auth->guard($guard)->guest()) { |
|
38 | - return response()->json(['message' => 'authentication-needed'], 401); |
|
39 | - } |
|
27 | + /** |
|
28 | + * Handle an incoming request. |
|
29 | + * |
|
30 | + * @param \Illuminate\Http\Request $request |
|
31 | + * @param \Closure $next |
|
32 | + * @param string|null $guard |
|
33 | + * @return mixed |
|
34 | + */ |
|
35 | + public function handle($request, Closure $next, $guard = null) |
|
36 | + { |
|
37 | + if ($this->auth->guard($guard)->guest()) { |
|
38 | + return response()->json(['message' => 'authentication-needed'], 401); |
|
39 | + } |
|
40 | 40 | |
41 | - if ($request->user()->isBanned == true) { |
|
42 | - return response('Unauthorized.', 401); |
|
43 | - } |
|
41 | + if ($request->user()->isBanned == true) { |
|
42 | + return response('Unauthorized.', 401); |
|
43 | + } |
|
44 | 44 | |
45 | - return $next($request); |
|
46 | - } |
|
45 | + return $next($request); |
|
46 | + } |
|
47 | 47 | } |
48 | 48 | \ No newline at end of file |