How to deal with Ajax Auth errors in CakePHP

I'm using the Auth component on my pages and I would like to show a login overlay when an Ajax action is called for which the user doesn't have permission.

Example:

User wants to edit a jeditable field, then when the users wants to change the value, he will first get a login/register overlay.

My current way is to check in the action for $_SESSION['Auth']['User'], however this seems to be very dirty and I want to do it in a clean way.

Currently my code is:

if(!$_SESSION['Auth']['User'])
{

$this->layout = 'ajax';
$this->render('loginpopup');    
return;

}

I would love the input of more experienced users, I'm using Jquery as my javascript library. Thanks in advance!