milesj/cake-auto_login — Issue #15: Documentation suggestion
Author: jocull
Created: 2012-01-15 18:13:12+00:00
State: open

One "gotcha" I struggled with a little is that in my login action I needed to check to see if the AutoLogin component had created my auth user before I was redirected to users/login. I had assumed it would handle this for me, but I was mistaken.

Adding this code to the top of the action solved my issues. If I missed some kind of callback or I'm not using this properly, please correct me.

//Already logged in?
$user = $this->Auth->user();
if(!empty($user)){
return $this->redirect($this->Auth->redirect());
}