views:

140

answers:

2

Hi,

im Using CakePHPs standard Auth mechanism, but I have some problems with that. Everytime a user logges in the password got hashed twice.

I have the Auth Component in the var $componets Array in the app_controller.php and one in the var $components Array from my users_controller where the login action is defined. I have defined a beforeFilter in my users_controller like this

  function beforeFilter(){
 parent::beforeFilter();      
  $this->Auth->autoRedirect = false;

Now when I print out my $this->data in cakephps hashPassword funktion in the Auth component file (auth.php line 854) like this

 function hashPasswords($data) {

pr($data);

I can see that pr(...) gets called twice.

Can anybody tell me why this is, or can help me to find a solution, please.

Greetz Jeremy

+3  A: 

You should only include the Auth component in your app_controller.php, since your UsersController extends AppController, the Auth component will be loaded inside your UsersController automatically.

iFunk
A: 

if it's loaded in the app_controller, there's no need to load it again anywhere else. troubleshooting auth problems

Try to disable the default hashing functions, with your own, so you may debug it more easily change hash function

djspark