supertokens / supertokens-auth-react

ReactJS authentication module for SuperTokens
https://supertokens.com
Other
260 stars 81 forks source link

Example Electron App out of date #808

Closed mluogh closed 2 months ago

mluogh commented 3 months ago

I followed all the instructions given here

However, when I try to login using the Google auth, I get an error:

GET http://localhost:3000/auth/callback/google?state=eyJzdGF0ZSI6ImI5YTQwY2NmMDExODRiYzUyMTA2ZSJ9&code=4%2F0AeaYSHDygHXmetG6eUwQVrHXcy3ow3rKNUSXou_i-7Tpt1D98dJxAe0xm7GVE8cUUJVSaQ&scope=email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+openid&authuser=0&prompt=none 
image

My understanding is that the desired flow is Electron -> Google -> API Server (localhost:3001) --[Deeplink to Electron]--> Electron, but from the error, it seems like we get Electron -> Google -> localhost:3000 ?

DBozhinovski commented 3 months ago

I'm getting something similar, but not the same: Screenshot from 2024-03-28 16-23-08

In any case, the demo is not working as expected, so I'll take a look.

rishabhpoddar commented 2 months ago

The example app has been fixed. The issue was that the frontend SDK was creating an authorization url (to google) which pointed to localhostL3000 instead of localhost:3001. So google redirected to localhost:3000, instead of 3001.

Have a look at the PR linked to this issue for the required code change