Google OAuth2 CORS Error

I’m trying to use the Oauth2 Component with Google as the service provider. Have everything setup as per my knowledge from the docs and reading posts on the forum. However can’t solve this CORS error.


My setup is as follows. I call a google_login server connect which calls the Oauth2 provider. I have also added “http://localhost:3000” in the google dashboard as an Authorised JavaScript origin.


image
Can anyone suggest what could be going wrong?

Hey @PraneetB,
Have you tried enabling CORS in the Server Connect settings panel? Click on the little cog and it will open the dialogue box where you can specify a wild card or specific domains for CORS purposes. It’s just below where you see App Flows in your Server Connect Actions. If you have not done so please try and see if that helps?

Thanks Dave, I do have it on though. Anything else I could be missing?

image

@Teodor or @patrick could you help me here please?

You should just link/redirect to the google_login endpoint and not load it using serverconnect.

Oh right, it should be a link and not a server action, that makes sense.

Thank you Patrick, it’s working now! Love it that Wappler’s made it so easy that we can provide this to our users right off the bat. Feels like cheating :grin: :grin: