original_string: public function loginAction($request)
      {
          $data = $request->get('data');
          $userModel = new ModelUser();
          $validUser = $userModel->validateLogin($data['email'], $data['password']);
  
          if (!$validUser) {
              $this->setMessage('danger', 'Not valid user / password combination');
              return $this->redirect(url('login'));
          }
  
          $this->session()->set('user', $userModel->record);
          $this->sessionClearMessages();
          return $this->redirect('/');
      }
code: public function loginAction($request)
      {
          $data = $request->get('data');
          $userModel = new ModelUser();
          $validUser = $userModel->validateLogin($data['email'], $data['password']);
  
          if (!$validUser) {
              $this->setMessage('danger', 'Not valid user / password combination');
              return $this->redirect(url('login'));
          }
  
          $this->session()->set('user', $userModel->record);
          $this->sessionClearMessages();
          return $this->redirect('/');
      }
code_tokens: public function loginAction ( $ request ) { $ data = $ request -> get ( 'data' ) ; $ userModel = new ModelUser ( ) ; $ validUser = $ userModel -> validateLogin ( $ data [ 'email' ] , $ data [ 'password' ] ) ; if ( ! $ validUser ) { $ this -> setMessage ( 'danger' , 'Not valid user / password combination' ) ; return $ this -> redirect ( url ( 'login' ) ) ; } $ this -> session ( ) -> set ( 'user' , $ userModel -> record ) ; $ this -> sessionClearMessages ( ) ; return $ this -> redirect ( '/' ) ; }
docstring: Handles the login action.
  
  @param $request
  
  @return \Symfony\Component\HttpFoundation\RedirectResponse
docstring_tokens: Handles the login action .