2016-06-21 6 views
1

php artisan 명령에 대해 다음과 같은 오류가 표시됩니다. laravel/dingo 패키지를 사용하고 있습니다.Laravel php artisan이 JWT의 오류를 표시합니다.

갔다 것 어떤 오류 "토큰을 요청에서 해석 할 수 없었던 을"이후 어떤 PHP 장인 명령을 보여주고있다

Loading composer repositories with package information 
Updating dependencies (including require-dev)       
    - Removing rap2hpoutre/laravel-log-viewer (v0.6.1) 
    - Removing dingo/blueprint (v0.1.5) 
    - Installing dingo/blueprint (v0.1.6) 
    Downloading: 100%   

    - Removing dingo/api (dev-master 8cd1a6c) 
    - Installing dingo/api (v1.0.0-beta3) 
    Downloading: 100%   

    - Removing cartalyst/support (v1.1.2) 
    - Installing cartalyst/support (v1.2.0) 
    Downloading: 100%   

Writing lock file 
Generating autoload files 
> php artisan optimize 

composer update 
> php artisan clear-compiled 


    [Tymon\JWTAuth\Exceptions\JWTException]   
    The token could not be parsed from the request 

그런 다음 오류가 발생한 다음 단계를 했 잘못된. 너무 혼란 스럽군요 : (

답변

0

나는 UserController에서 생성자를 사용하고 있기 때문에 호출하는 getAuthenticatedUser 메소드가 있습니다. $ user = JWTAuth :: parseToken() -> authenticate)

내 생성자에서 $ this-> user = $ this-> getAuthenticatedUser();를 설정하여 장인이 적합하게 만듭니다. 생성자를 제거하는 것 외에 다른 방법을 찾지 못했습니다. 누구든지 더 좋은 제안이 있으면 알고 싶습니다.