app/maguttiCms/Website/Controllers/Auth/LoginController.php
/**
     * Handle a login request to the application.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response
     */
Handle a login request to the application.
Handle a login request to the application .
public function login(Request $request)
     {
         $this->validateLogin($request);
         if ($request->redirectTo) {
              if(in_array($request->redirectTo, config('maguttiCms.security.redirectTo')) == true) {
                 $this->redirectTo = $request->redirectTo;
              }
          }
          elseif(!StoreFeatures::isStoreEnabled()){
             $this->redirectTo='users/profile';
          }
         if ($this->hasTooManyLoginAttempts($request)) {
             $this->fireLockoutEvent($request);
             return $this->sendLockoutResponse($request);
         }
         if ($this->attemptLogin($request)) {
             if ($this->guard()->user()->isActive()){
                 return $this->sendLoginResponse($request);
             }
             else {
                 $this->logout($request);
                 $this->incrementLoginAttempts($request);
                 return $this->sendInactiveUserLoginResponse($request);
             }
         }
         $this->incrementLoginAttempts($request);
         return $this->sendFailedLoginResponse($request);
     }
public function login ( Request $ request ) { $ this -> validateLogin ( $ request ) ; if ( $ request -> redirectTo ) { if ( in_array ( $ request -> redirectTo , config ( 'maguttiCms.security.redirectTo' ) ) == true ) { $ this -> redirectTo = $ request -> redirectTo ; } } elseif ( ! StoreFeatures :: isStoreEnabled ( ) ) { $ this -> redirectTo = 'users/profile' ; } if ( $ this -> hasTooManyLoginAttempts ( $ request ) ) { $ this -> fireLockoutEvent ( $ request ) ; return $ this -> sendLockoutResponse ( $ request ) ; } if ( $ this -> attemptLogin ( $ request ) ) { if ( $ this -> guard ( ) -> user ( ) -> isActive ( ) ) { return $ this -> sendLoginResponse ( $ request ) ; } else { $ this -> logout ( $ request ) ; $ this -> incrementLoginAttempts ( $ request ) ; return $ this -> sendInactiveUserLoginResponse ( $ request ) ; } } $ this -> incrementLoginAttempts ( $ request ) ; return $ this -> sendFailedLoginResponse ( $ request ) ; }
Handle a login request to the application.
Handle a login request to the application .
// If the redirect to path is in white list. // if store is disabled redirect to user profile page // If the class is using the ThrottlesLogins trait, we can automatically throttle // the login attempts for this application. We'll key this by the username and // the IP address of the client making these requests into this application. // If the login attempt was unsuccessful we will increment the number of attempts // to login and redirect the user back to the login form. Of course, when this // user surpasses their maximum number of attempts they will get locked out.