[DEV-1739] Clean up login to post middleware.