method() === HTTPRequest::POST) { $validation = Validation::factory($request->post()) ->label('login', 'Логин') ->label('password', 'Пароль') ->rule('login', 'required') ->rule('password', 'required'); if ($validation->check() && Auth::instance()->login($request->post('login'), $request->post('password'))) { return $this->renderContent('index', ['error' => null, 'user' => Auth::instance()->getUser()]); } $error = 'Неверный логин или пароль'; } return $this->renderContent('index', ['error' => $error, 'user' => Auth::instance()->getUser()]); } }