我正在使用 ion auth 进行 CI 身份验证。注册后自动登录出现问题。我的注册没有问题,所有数据都已插入,我可以使用我的登录表单登录。但是在用户注册后它不会重定向到主页。
下面是我的代码。任何人都可以看看吗?
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');
}