1
我对我的CI认证使用ion认证。注册后我遇到了自动登录问题。我没有注册的问题,所有的数据都被插入,我可以登录我的登录表单。但是在用户注册后它不会重定向到主页。离子认证在注册后不会重定向
下面是我的代码。任何人都可以看看吗?
if ($this->form_validation->run() == TRUE)
{
//if form validation not false, password var
$username = $this->input->post('email');
$password = $this->input->post('password');
$email = $this->input->post('email');
$additional_data = array(
'first_name' => $this->input->post('first_name'),
'last_name' => $this->input->post('last_name'),
);
}
if ($this->form_validation->run() == TRUE && $this->ion_auth->register($username, $password, $email, $additional_data))
{
//check to see if we are creating the user
//redirect them back to the home page
$this->session->set_flashdata('msg', "User Created");
redirect("auth/home", 'refresh');
}
else
{
$this->session->set_flashdata('msg', validation_errors('<div>','</div>'));
redirect('auth/index','refresh');
}
您是否检查过错误,例如代码中的通知?在此代码之前启用显示错误并搜索空白/制表符,如果某些输出已经通过重定向使用标题,则通常不会重定向。 – 2012-07-07 22:26:17
没有错误。它实际上重定向,但它重定向到登录页面,我不得不手动登录 – vzhen 2012-07-07 22:40:03