Authentication index

How does this code even execute? You haven’t passed anything that the canIndex function can accept in its required $resource parameter. Is there something else happening somewhere that you’re not showing?