我是很新的驗證模塊,我試圖讓登錄工作,閱讀文檔和谷歌上搜索想瘋了,我有這個簡單的代碼後...Kohana的身份驗證登錄失敗每次
Auth::instance()->login('test', 'test');
if (Auth::instance()->logged_in()){
$this->request->redirect('user/index/');
}else{
echo 'fail';
}
這始終返回false,我的註冊腳本是這樣的:
$model = ORM::factory('user');
$model->values(array(
'username' => 'admin',
'email' => '[email protected]',
'password' => 'test',
'password_confirm' => 'test',
));
$model->save();
它創建用戶蠻好的,也將其設置role_id
爲1和2,這意味着我已經管理員/登錄權限,但它一直沒有反正,如果我使用Auth::instance()->force_login($user);
一切工作都很好,所以我猜測p可能與哈希有關,但我不知道在哪裏。
是'驗證::實例() - >登錄( '管理', '測試');'? – biakaveron 2012-01-08 10:21:19