protected function handlerUserAuthLogin($user)
{
if ($user instanceof Scalr_Account_User || $user instanceof Entity\Account\User) {
$this->user = $user;
$teams = [];
// Teams are needed for the audit log
foreach ($user->getTeams() as $rec) {
$teams[$rec['id']] = $rec['name'];
}
$lastVisit = $user->dtLastLogin ?: $user->dtCreated;
$data = ['.result' => 'success', '.teams' => $teams, '.last_login' => $lastVisit ? static::getTimestamp(strtotime($lastVisit)) : null, '.user_type' => $user->type];
}
return isset($data) ? $data : $user;
}