@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | /** |
| 42 | 42 | * Return the logged in user account. |
| 43 | 43 | * |
| 44 | - * @return object |
|
| 44 | + * @return \Illuminate\Http\JsonResponse |
|
| 45 | 45 | */ |
| 46 | 46 | public function getAccount() |
| 47 | 47 | { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | /** |
| 53 | 53 | * Logout the user. |
| 54 | 54 | * |
| 55 | - * @return void |
|
| 55 | + * @return \Illuminate\Http\JsonResponse |
|
| 56 | 56 | */ |
| 57 | 57 | public function getLogout() |
| 58 | 58 | { |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * Handle a registration request. |
| 64 | 64 | * |
| 65 | 65 | * @param \Illuminate\Http\Request $request |
| 66 | - * @return \Illuminate\Http\Response |
|
| 66 | + * @return \Illuminate\Http\JsonResponse |
|
| 67 | 67 | */ |
| 68 | 68 | public function postRegister(Request $request) |
| 69 | 69 | { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * Handle a login request to the application. |
| 77 | 77 | * |
| 78 | 78 | * @param \Illuminate\Http\Request $request |
| 79 | - * @return \Illuminate\Http\Response |
|
| 79 | + * @return \Illuminate\Http\JsonResponse|null |
|
| 80 | 80 | */ |
| 81 | 81 | public function postLogin(Request $request) |
| 82 | 82 | { |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * Handle an assign groups to user request. |
| 97 | 97 | * |
| 98 | 98 | * @param \Illuminate\Http\Request $request |
| 99 | - * @return \Illuminate\Http\Response |
|
| 99 | + * @return \Illuminate\Http\JsonResponse |
|
| 100 | 100 | */ |
| 101 | 101 | public function postAssigngroups(Request $request) |
| 102 | 102 | { |
@@ -52,32 +52,26 @@ |
||
| 52 | 52 | { |
| 53 | 53 | $error = \ErrorHandler::dbQueryError(); |
| 54 | 54 | return \Response::json($error['message'], $error['status']); |
| 55 | - } |
|
| 56 | - else if ($e instanceof \predis\connection\connectionexception) |
|
| 55 | + } else if ($e instanceof \predis\connection\connectionexception) |
|
| 57 | 56 | { |
| 58 | 57 | $error = \ErrorHandler::redisNotRunning(); |
| 59 | 58 | return \Response::json($error['message'], $error['status']); |
| 60 | - } |
|
| 61 | - else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) |
|
| 59 | + } else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) |
|
| 62 | 60 | { |
| 63 | 61 | $error = \ErrorHandler::tokenExpired(); |
| 64 | 62 | return \Response::json($error['message'], $error['status']); |
| 65 | - } |
|
| 66 | - else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) |
|
| 63 | + } else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) |
|
| 67 | 64 | { |
| 68 | 65 | $error = \ErrorHandler::noPermissions(); |
| 69 | 66 | return \Response::json($error['message'], $error['status']); |
| 70 | - } |
|
| 71 | - else if ($e instanceof \Tymon\JWTAuth\Exceptions\JWTException) |
|
| 67 | + } else if ($e instanceof \Tymon\JWTAuth\Exceptions\JWTException) |
|
| 72 | 68 | { |
| 73 | 69 | $error = \ErrorHandler::unAuthorized(); |
| 74 | 70 | return \Response::json($error['message'], $error['status']); |
| 75 | - } |
|
| 76 | - else if ($e instanceof HttpException) |
|
| 71 | + } else if ($e instanceof HttpException) |
|
| 77 | 72 | { |
| 78 | 73 | return \Response::json($e->getMessage(), $e->getStatusCode()); |
| 79 | - } |
|
| 80 | - else |
|
| 74 | + } else |
|
| 81 | 75 | { |
| 82 | 76 | return parent::render($request, $e); |
| 83 | 77 | } |
@@ -190,8 +190,7 @@ discard block |
||
| 190 | 190 | if ($request->has('id')) |
| 191 | 191 | { |
| 192 | 192 | $rule = str_replace('{id}', $request->get('id'), $rule); |
| 193 | - } |
|
| 194 | - else |
|
| 193 | + } else |
|
| 195 | 194 | { |
| 196 | 195 | $rule = str_replace(',{id}', '', $rule); |
| 197 | 196 | } |
@@ -232,8 +231,7 @@ discard block |
||
| 232 | 231 | { |
| 233 | 232 | $error = $this->errorHandler->notFound('method'); |
| 234 | 233 | abort($error['status'], $error['message']); |
| 235 | - } |
|
| 236 | - else if ( ! in_array($permission, $this->skipLoginCheck)) |
|
| 234 | + } else if ( ! in_array($permission, $this->skipLoginCheck)) |
|
| 237 | 235 | { |
| 238 | 236 | \JWTAuth::parseToken()->authenticate(); |
| 239 | 237 | if ( ! in_array($permission, $this->skipPermissionCheck) && ! \Core::users()->can($permission, $this->model)) |