feat: Implement VM restart, auto-renew invoice functionality, and client invoice detail API, alongside admin UI improvements.
This commit is contained in:
@@ -8,7 +8,8 @@ use App\Http\Requests\Api\Client\ClientRegisterRequest;
|
||||
use App\Http\Requests\Api\Client\ClientUpdateRequest;
|
||||
use App\Http\Resources\Api\Client\ClientResource;
|
||||
use App\Services\Api\Client\ClientAuthService;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Tymon\JWTAuth\Facades\JWTAuth;
|
||||
use Tymon\JWTAuth\Exceptions\JWTException;
|
||||
|
||||
/**
|
||||
* @OA\Tag(
|
||||
@@ -230,4 +231,25 @@ class ClientController extends Controller
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function refresh()
|
||||
{
|
||||
try {
|
||||
$newToken = JWTAuth::parseToken()->refresh();
|
||||
$user = JWTAuth::setToken($newToken)->toUser();
|
||||
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'data' => [
|
||||
'token' => $newToken,
|
||||
'client' => new ClientResource($user),
|
||||
],
|
||||
]);
|
||||
} catch (JWTException $e) {
|
||||
return response()->json([
|
||||
'error' => true,
|
||||
'message' => 'Không thể làm mới phiên đăng nhập. Vui lòng đăng nhập lại.',
|
||||
], 401);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user