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 Error #26

Open
javanese84 opened this issue Apr 18, 2023 · 1 comment
Open

CORS Error #26

javanese84 opened this issue Apr 18, 2023 · 1 comment

Comments

@javanese84
Copy link

Hi guys,

thanks for creating this library. When using it in my Angular project, and want to try to create an invoice (example code taken from this repo), I am getting an CORS Error, preventing me from creating the invoice in lexoffice. With my local Postman and a generic request, everything is working fine. Can you please advice what to do in this case? In Lexoffice, I don't know a way to configure, which host may access the api.

Thanks and best regards

@valentinlehmann
Copy link

CORS only applies when you use the api in a browser environment. As this would leak your Lexoffice API key it isn't intended and therefore the Lexoffice API doesn't apply any CORS headers.
The proper solution would be to write a backend which consumes the api and responds to the frontend with the needed data. If another service (e.g. a proxy) handles authorization and you want to use the api on the client side, you could use a CORS proxy.

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