public function authorizePost() { $params = Authorizer::getAuthCodeRequestParams(); $params['user_id'] = Auth::user()->user_id; $redirectUri = '/'; // If the user has allowed the client to access their 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 their data, redirect back to the client with an error message. if (Request::has('deny')) { $redirectUri = Authorizer::authCodeRequestDeniedRedirectUri(); } return redirect($redirectUri); }