write auth info to rootScope, show/hide login,register,logout buttons