@@ -200,7 +200,7 @@ |
||
| 200 | 200 | * |
| 201 | 201 | * @param Request $request |
| 202 | 202 | * |
| 203 | - * @return mixed |
|
| 203 | + * @return JsonResponse |
|
| 204 | 204 | */ |
| 205 | 205 | public function confirmChangePassword(Request $request): JsonResponse |
| 206 | 206 | { |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | /** |
| 66 | 66 | * Check if a Key exists in the Session. |
| 67 | 67 | * |
| 68 | - * @param mixed $key |
|
| 68 | + * @param string $key |
|
| 69 | 69 | * |
| 70 | 70 | * @return bool |
| 71 | 71 | */ |
@@ -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 |