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

How to use advanced-http plugin with ionic capacitor app to handle CORS #77

Open
killian2301 opened this issue Nov 3, 2021 · 1 comment

Comments

@killian2301
Copy link

killian2301 commented Nov 3, 2021

I have been having trouble to understand what this phrase means in the docs "It includes code extensions for core cordova plugins to run the Ionic app such as Advanced HTTP and SafariViewController.".
What are those code extensions? Can i use it with Capacitor app?

My capacitor app has CORS errors, because it seems that ionic-appauth is using Angular HttpClient instead of using Advanced HTTP, but i don't know what should i change to make it work with the plugin.

I have tried using the NgHttpService and the CordovaRequestor in the core.module.ts, but it does't work either.

Thank you!

@mraible
Copy link
Collaborator

mraible commented Aug 25, 2022

The latest code on the main branch uses Capacitor's capacitor-community/http for iOS. As far as I can tell, this doesn't send an origin header and therefore no CORS configuration is needed. For Android, you'll still need to allow CORs from http://localhost.

You can try the current version of this library from GitHub using the following in your package.json:

"ionic-appauth": "github:wi3land/ionic-appauth",

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

2 participants