Ejemplo n.º 1
0
 public function postLogin2(LoginRequest $request)
 {
     $credentials = $request->only('email', 'password');
     if ($this->auth->attempt($credentials, $request->has('remember'))) {
         return redirect()->intended($this->redirectPath());
     }
     return redirect($this->loginPath())->withInput($request->only('email', 'remember'))->withErrors(['email' => $this->getFailedLoginMessage()]);
 }
Ejemplo n.º 2
0
 /**
  * Handle a login request to the application.
  *
  * @param  LoginRequest $request
  * @return Response
  */
 public function postLogin(Requests\Auth\LoginRequest $request)
 {
     $credentials = $request->only('email', 'password');
     if ($this->auth->attempt($credentials, $request->has('remember'))) {
         return redirect('/home');
     }
     return redirect('/auth/login')->withInput($request->only('email'))->withErrors(['email' => 'These credentials do not match our records.']);
 }
 /**
  * Handle a login request to the application.
  *
  * @param  App\Http\Requests\LoginRequest  $request
  * @return Response
  */
 public function postLogin(LoginRequest $request)
 {
     $logValue = $request->input('log');
     $logAccess = filter_var($logValue, FILTER_VALIDATE_EMAIL) ? 'email' : 'username';
     $credentials = [$logAccess => $logValue, 'password' => $request->input('password')];
     if ($this->auth->attempt($credentials, $request->has('memory'))) {
         return redirect('/');
     }
     return redirect('/auth/login')->with('error', trans('front/login.credentials'))->withInput($request->only('email'));
 }
Ejemplo n.º 4
0
 /**
  * Handle a login request to the application.
  *
  * @param  App\Http\Requests\LoginRequest  $request
  * @param  App\Services\MaxValueDelay  $maxValueDelay
  * @param  Guard  $auth
  * @return Response
  */
 public function postLogin(LoginRequest $request, MaxValueDelay $maxValueDelay, Guard $auth)
 {
     $logValue = $request->input('log');
     if ($maxValueDelay->check($logValue)) {
         return redirect('/auth/login')->with('error', trans('front/login.maxattempt'));
     }
     $logAccess = filter_var($logValue, FILTER_VALIDATE_EMAIL) ? 'email' : 'username';
     $credentials = [$logAccess => $logValue, 'password' => $request->input('password')];
     if (!$auth->validate($credentials)) {
         $maxValueDelay->increment($logValue);
         return redirect('/auth/login')->with('error', trans('front/login.credentials'))->withInput($request->only('log'));
     }
     $user = $auth->getLastAttempted();
     if ($user->confirmed) {
         $auth->login($user, $request->has('memory'));
         if ($request->session()->has('user_id')) {
             $request->session()->forget('user_id');
         }
         return redirect('/');
     }
     $request->session()->put('user_id', $user->id);
     return redirect('/auth/login')->with('error', trans('front/verify.again'));
 }