injected login controller to flag viewer controller. (should probably make an API service instead).