Vheissu/WolfAuth-for-Codeigniter-2.0- — Issue #26: cannot login after creating new account
Author: kokers
Created: 2011-10-21 11:23:44+00:00
State: open

So basicaly i used a form from view users/add and add in controller testauth:

public function add_user(){
$this->form_validation->set_rules('username','Username','required');
$this->form_validation->set_rules('password','Password','required');
if($this->form_validation->run()){
create_user($this->input->post('username'),$this->input->post('password'));
$this->load->view('users/add');
}else{
$this->load->view('users/add');
}

then, i tried to login with username and password i created but with no luck. I believe the problem was with create_user function in driver libraries/drivers/Auth_simpleauth (line around 1282) where the password was salt, and not actually entered password.

I changed it from :

$salt = $this->generate_random();
$password = $this->create_password($this->generate_random(), $salt);

to:

$salt = $this->generate_random();
$password = $this->create_password($password, $salt);

and now i can log in. :o) Great work btw. :o)