Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Json 登录时出现Kohana Auth怪异错误消息_Json_Kohana_Authentication - Fatal编程技术网

Json 登录时出现Kohana Auth怪异错误消息

Json 登录时出现Kohana Auth怪异错误消息,json,kohana,authentication,Json,Kohana,Authentication,我已经启动了Kohana Auth,运行良好,除了一件小事。 使用扩展Model_Auth_User的Model_User,当使用正确的用户名和错误的密码登录时,我得到一个json响应{“username”:“login.username.invalid”}。其他每一个错误都很有效。这是唯一困扰我的事情。有什么想法吗? 用户确实存在,因为我可以使用正确的用户名和密码登录,只有正确的用户名和错误的密码才会产生这种情况。诚实登录(提交).username(输入).invalid(错误类型)={“us

我已经启动了Kohana Auth,运行良好,除了一件小事。 使用扩展Model_Auth_User的Model_User,当使用正确的用户名和错误的密码登录时,我得到一个json响应{“username”:“login.username.invalid”}。其他每一个错误都很有效。这是唯一困扰我的事情。有什么想法吗?
用户确实存在,因为我可以使用正确的用户名和密码登录,只有正确的用户名和错误的密码才会产生这种情况。诚实登录(提交).username(输入).invalid(错误类型)={“username”:“login.username.invalid”}看起来像是某种json错误。我搞不清楚是什么原因造成的

modules/auth/classes/model/auth/user.php:

if ($this->loaded() AND Auth::instance()->login($this, $array['password'], $remember))
{
    if (is_string($redirect))
    {
        // Redirect after a successful login
        Request::instance()->redirect($redirect);
    }

    // Login is successful
    $status = TRUE;
}
else
{
    $array->error('username', 'invalid');
}
因此,无论用户名或密码是否有效,都会返回此错误。这取决于您定义应该使用哪个消息文件来检索验证错误文本(出于安全目的,它应该类似于“用户名或密码不正确”,以便最终破解者不知道错误是关于什么的)