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 while creating a POST request on 'https://lib.openlaw.io/api/v1/default/app/login' from localhost or public IP #208

Open
adnfyz opened this issue May 5, 2020 · 3 comments

Comments

@adnfyz
Copy link

adnfyz commented May 5, 2020

Earlier, I was able to get the access token from OpenLaw API, but now I am facing this error while login From the Angular framework.
I changed the host from 127.0.0.1:4200 to 192.168.1.x:4200, but nothing works.
Anybody else faced this issue, please update.

@adridadou
Copy link
Member

You usually see a CORS error if the login fails. What url are u using to log in?

@adnfyz
Copy link
Author

adnfyz commented May 5, 2020

Login URL: https://lib.openlaw.io/api/v1/default/app/login

private apiClient = new APIClient("https://lib.openlaw.io/api/v1/default"); let adminEmail = "[email protected]"; let password = "xxxxxx"; this.apiClient.login(adminEmail, password);

@adridadou
Copy link
Member

usually you get a CORS error if there was another issue previously. When the server returns an error (5xx or 4xx http code) then the header for CORS is not added and you see this error.

Do you see another error in the network logs ?

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