Add authentication logic to contacts controller.