芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/store.kwesioben.com/vendor/laravel/socialite/src/Two/TwitterProvider.php
buildAuthUrlFromBase('https://twitter.com/i/oauth2/authorize', $state); } /** * {@inheritdoc} */ protected function getTokenUrl() { return 'https://api.twitter.com/2/oauth2/token'; } /** * {@inheritdoc} */ protected function getUserByToken($token) { $response = $this->getHttpClient()->get('https://api.twitter.com/2/users/me', [ RequestOptions::HEADERS => ['Authorization' => 'Bearer '.$token], RequestOptions::QUERY => ['user.fields' => 'profile_image_url'], ]); return Arr::get(json_decode($response->getBody(), true), 'data'); } /** * {@inheritdoc} */ protected function mapUserToObject(array $user) { return (new User)->setRaw($user)->map([ 'id' => $user['id'], 'nickname' => $user['username'], 'name' => $user['name'], 'avatar' => $user['profile_image_url'], ]); } /** * {@inheritdoc} */ public function getAccessTokenResponse($code) { $response = $this->getHttpClient()->post($this->getTokenUrl(), [ RequestOptions::HEADERS => ['Accept' => 'application/json'], RequestOptions::AUTH => [$this->clientId, $this->clientSecret], RequestOptions::FORM_PARAMS => $this->getTokenFields($code), ]); return json_decode($response->getBody(), true); } /** * {@inheritdoc} */ protected function getCodeFields($state = null) { $fields = parent::getCodeFields($state); if ($this->isStateless()) { $fields['state'] = 'state'; } return $fields; } }