AbanteCart Community

AbanteCart Development => API Development => Topic started by: ubaid on January 25, 2023, 08:50:54 AM

Title: Error with Login API on AbanteCart Storefront in ReactJS
Post by: ubaid on January 25, 2023, 08:50:54 AM
I am currently in the process of creating an AbanteCart storefront using ReactJS. However, I am encountering an issue with the login API. Despite providing all the required credentials correctly, the API always returns an error and fails to log me in.

I have double-checked that I am using the correct endpoint and that the credentials I am providing are correct. I am unsure if I am missing something or if there is a bug in the API.

I would greatly appreciate any assistance in resolving this issue. Kindly help me out.

Thank you.


Title: Re: Error with Login API on AbanteCart Storefront in ReactJS
Post by: yonghan79 on January 25, 2023, 10:40:25 AM
Hi,

Please try to pass the the username and password from body.

Title: Re: Error with Login API on AbanteCart Storefront in ReactJS
Post by: ubaid on January 26, 2023, 07:27:34 AM
Thanks for your reply. But still the problem is the same.
Title: Re: Error with Login API on AbanteCart Storefront in ReactJS
Post by: yonghan79 on January 26, 2023, 11:07:26 AM
On params, you just need the rt. loginname, password, api_key(optional) should be in body.
Title: Re: Error with Login API on AbanteCart Storefront in ReactJS
Post by: ubaid on January 31, 2023, 02:57:54 AM
It is working on postman, but when I am trying to post through axios in reactjs it is showing this CORS error


"Access to XMLHttpRequest at 'api url' from origin 'localhost' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status."