HalfdanJ / svelte-google-auth

43 stars 3 forks source link

Auth code response: RequestInit: duplex option is required when sending a body. #43

Open gil-obradors opened 1 year ago

gil-obradors commented 1 year ago

Hi! Nice work! I have cloned the project, configured the OAUTH2 in my personal project.... Everything is fine..

But I can't authenticate. I see the google popup, I agree and allow all steps, but finally falls into callback

image

This is the console.log output at https://github.com/HalfdanJ/svelte-google-auth/blob/518953b5ec00f7fef0d0fd998049daefcd7f145d/src/lib/client.ts#L52 Auth code response: RequestInit: duplex option is required when sending a body.

Why choose XMLHttprequest insteat fetch API? How do I enable duplex option in XMLHttprequest? It seems no to be possible, this docs recommends use websockets instead AJAX

Versions: svelte": "^3.44.0", "vite": "^3.0.0" "googleapis": "^110.0.0",

Again thanks for share this work!

HalfdanJ commented 1 year ago

Hmm interesting. I haven't done any work with this lib the last couple of months, so unsure if something might have changed.

Reason for not using fetch is that fetch was introduced in node 18 i believe. And I wanted to support versions lower than that without using node-fetch. But if switching would solve the issue, then I'd be open to do that.