0

을 테스트하고이 튜토리얼에서 설정하려고 할 때 (404) : https://mattstauffer.co/blog/introducing-laravel-passport찾을 수 없음 - 제작 한 여권하여 OAuth 새로운 laravel 5.3 프로젝트를

그러나 나는 HTTP에서 편안한 요청을 전송하여 OAuth는 서버를 확인하려고 할 때 http://localhost/pcheck/user 그리고 헤더 설정 : "Application/json"

내 web.php 호선 파일 :

// First route that user visits on consumer app Route::get('/redirect', function() { // Build the query parameter string to pass auth information to our request $query = http_build_query([ 'client_id' => 3, 'redirect_uri' => 'http://localhost/pcheck/callback', 'response_type' => 'code', 'scope' => 'conference' ]); 

// Redirect the user to the OAuth authorization page 
return redirect('http://localhost/pcheck/oauth/authorize?' . $query); 

}); 

// Route that user is forwarded back to after approving on server Route::get('/callback', function (Request $request) { $http = new GuzzleHttp\Client; 

$response = $http->post('http://localhost/pcheck/oauth/token', [ 
    'form_params' => [ 
     'grant_type' => 'authorization_code', 
     'client_id' => '3', 
     'client_secret' => 'azWM7CGS4UtIQ30sd5bwW5s53P52QjaRmUdWjKpx', 
     'redirect_uri' => 'http://localhost/pcheck/callback', 
     'code' => $request->code, 
    ], 
]); 

return json_decode((string) $response->getBody(), true); 

}); 
을 404

내 요청 URL - 부가 요청할 파이어 폭스에서 내가 찾을 수 없음 얻을3210

내 api.php의 경로 파일 :

Route::get('/user', function (Request $request) { return $request->user(); })->middleware('auth:api');

내가 어떤 생각이 틀렸다 어디 몰라?

답변

0

해결책을 찾았습니다. sudo 명령으로 npm을 설치하기 때문에 sudo없이 npm 모듈을 설치해야합니다. 따라서이 문제를 해결하려면 npm 모듈을 제거한 다음 npm install을 실행하고 필요한 모든 종속성을 설치할 때까지 기다려야합니다.

는 참고 : 당신은 파일을 bootstrap.js 및 package.json 파일은 다음과 같아야합니다

Package.json :

{ 
    "private": true, 
    "scripts": { 
    "prod": "gulp --production", 
    "dev": "gulp watch" 
    }, 
    "devDependencies": { 
    "bootstrap-sass": "^3.3.7", 
    "buble": "^0.14.0", 
    "buble-loader": "^0.2.1", 
    "gulp": "^3.9.1", 
    "jquery": "^3.1.0", 
    "laravel-elixir": "^6.0.0-11", 
    "laravel-elixir-vue-2": "^0.2.0", 
    "laravel-elixir-webpack-official": "^1.0.2", 
    "lodash": "^4.16.2", 
    "vue": "^2.0.1", 
    "vue-loader": "^9.7.0", 
    "vue-resource": "^1.0.3", 
    "webpack": "^2.1.0-beta.22" 
    } 
} 

Bootstrap.js :

window._ = require('lodash'); 

/** 
* We'll load jQuery and the Bootstrap jQuery plugin which provides support 
* for JavaScript based Bootstrap features such as modals and tabs. This 
* code may be modified to fit the specific needs of your application. 
*/ 

window.$ = window.jQuery = require('jquery'); 
require('bootstrap-sass'); 

/** 
* Vue is a modern JavaScript library for building interactive web interfaces 
* using reactive data binding and reusable components. Vue's API is clean 
* and simple, leaving you to focus on building your next great project. 
*/ 

window.Vue = require('vue'); 
require('vue-resource'); 

/** 
* We'll register a HTTP interceptor to attach the "CSRF" header to each of 
* the outgoing requests issued by this application. The CSRF middleware 
* included with Laravel will automatically verify the header's value. 
*/ 

Vue.http.interceptors.push((request, next) => { 
    request.headers.set('X-CSRF-TOKEN', Laravel.csrfToken); 

    next(); 
}); 


Vue.http.options.credentials = true; //very important 
/** 
* Echo exposes an expressive API for subscribing to channels and listening 
* for events that are broadcast by Laravel. Echo and event broadcasting 
* allows your team to easily build robust real-time web applications. 
*/ 

// import Echo from "laravel-echo" 

// window.Echo = new Echo({ 
//  broadcaster: 'pusher', 
//  key: 'your-pusher-key' 
// }); 

그리고 또 다른 팁 중요한 npm 버전을 사용해야합니다 : 6.9.

희망 기타 문제는이 솔루션으로 신속하게 해결됩니다.

관련 문제