In case anyone else runs into the issue, there was problem in the reverse proxy where the whole request wasn't being properly forwarded to the Firebase Auth server - just the URL. We had to change from fetch(updatedURL)
to `fetch(new Request(updatedUrl, oldRequest))`. And then it worked :)