public function getLogin() { if (!Input::has('code')) { return Redirect::to($this->github->getAuthUrl()); } $githubUser = $this->github->authorize(Input::all()); $request = new LoginMemberThroughGithubRequest($githubUser); try { $response = $this->bus->execute($request); } catch (MemberNotFoundException $e) { Session::put('githubUser', $githubUser); return Redirect::action('AuthController@getSignupConfirm'); } Auth::login($response->member, true); Session::forget('userGithubData'); return $this->redirectIntended(action('ForumController@getListThreads')); }
/** * Obtain the user information from GitHub. * * @return \Illuminate\Http\RedirectResponse */ public function authByGithub() { return $this->github->authBySocialite($this); }