Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS policies blocked the Android Google Authentication #280

Open
achraf-io opened this issue May 8, 2023 · 0 comments
Open

CORS policies blocked the Android Google Authentication #280

achraf-io opened this issue May 8, 2023 · 0 comments

Comments

@achraf-io
Copy link

Hello, hope you all doing good.
I m using the Plugin in my MERN app, I generate the mobile app using capacitor 4, everything works fine !
In my google auth process, I have followed the documentation, and I updated my MainActivity like this :

    // Initializes the Capacitor GoogleAuth plugin
    registerPlugin(GoogleAuth.class);

    // Initialize the Facebook SDK
    FacebookSdk.sdkInitialize(getApplicationContext());

    AppEventsLogger.activateApp(getApplication(), "**********");

In android Studio, I get the window in order to auth with google, but when I click on continue it throw me this error :
E/Capacitor/Console: File: http://localhost/#/auth/sign-in/default - Line 0 - Msg: Access to XMLHttpRequest at 'https://jumatik.ma/#/auth/sign-in' (redirected from 'https://jumatik.ma:6001/auth/oauth/google/callback') from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I don't know what is really triggering this, but it something related to CORS policies.
Thanks for you efforts.

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant