Fixed login bug by broadcasting event rather than using deferreds in authentication factory