add auth middleware to facebook function