cleanup auth middleware