|
@@ -44,21 +44,21 @@ class TokenMiddleware implements MiddlewareInterface
|
|
|
if (strlen($token) > 0) {
|
|
|
$token = JWTUtil::handleToken($token);
|
|
|
if ($token == false || !$this->jwt->checkToken($token)) {
|
|
|
- throw new TokenValidException(1005, 1002);
|
|
|
+ throw new TokenValidException(1005, 401);
|
|
|
}
|
|
|
|
|
|
$authId = $token->getClaim('authId');
|
|
|
$user = User::where('id', $authId)->where(['enable'=> 'T'])->first();
|
|
|
if(!$user){
|
|
|
- throw new TokenValidException(1029, 1002);
|
|
|
+ throw new TokenValidException(1029, 401);
|
|
|
}
|
|
|
}else{
|
|
|
//return ApiResource::failed(1010);
|
|
|
- throw new TokenValidException(1010, 1002);
|
|
|
+ throw new TokenValidException(1010, 401);
|
|
|
}
|
|
|
|
|
|
} catch (\Exception $exception){
|
|
|
- throw new TokenValidException(1006, 1002);
|
|
|
+ throw new TokenValidException(1006, 401);
|
|
|
}
|
|
|
|
|
|
|