Modified UiAuthenticator, made output of HTTP CORS headers conditional.