add auth config and conditional logging based on mode