/** * @return \Illuminate\Http\RedirectResponse */ public function getCallback() { $accessToken = $this->auth->getToken(\Input::get('code')); $user = $this->auth->getUser($accessToken['access_token']); // GitHubアカウントでログインさせる $result = \Auth::attempt(['name' => $user['login'], 'id' => $user['id']], true); if (!$result) { return \Redirect::action('home.index')->withErrors(['auth_error' => 'Forbidden.']); } return \Redirect::action('webmaster.index'); }