我就是直接粘贴的
Route::post('oauth/authorize', ['as' => 'oauth.authorize.post', 'middleware' => ['csrf', 'check-authorization-params', 'auth'], function () {
$params = Authorizer::getAuthCodeRequestParams();
$params['user_id'] = Auth::user()->id;
$redirectUri = '/';
// If the user has allowed the client to access its data, redirect back to the client with an auth code.
if (Request::has('approve')) {
$redirectUri = Authorizer::issueAuthCode('user', $params['user_id'], $params);
}
// If the user has denied the client to access its data, redirect back to the client with an error message.
if (Request::has('deny')) {
$redirectUri = Authorizer::authCodeRequestDeniedRedirectUri();
}
return Redirect::to($redirectUri);
}]);