/** * @param boolean $hasCode * @param AuthenticateUserListener $listener * @return \Symfony\Component\HttpFoundation\RedirectResponse */ public function execute($hasCode, AuthenticateUserListener $listener) { if (!$hasCode) { return $this->getAuthorizationFirst(); } if (Config::get('kagi.kagi_social') == 'github') { $user = $this->users->findByUsernameOrCreateGithub($this->getGithubUser()); } if (Config::get('kagi.kagi_social') == 'google') { $user = $this->users->findByUsernameOrCreateGoogle($this->getGoogleUser()); } //dd($user); $this->auth->login($user, true); return $listener->userHasLoggedIn($user); }
/** * Store a newly created resource in storage. * * @param App\requests\UserCreateRequest $request * * @return Response */ public function store(UserCreateRequest $request) { dd("store"); $this->user->store($request->all()); return redirect('user')->with('ok', trans('back/users.created')); }