Login user and set CORS.