Run auth stuff inside $apply block