support

Author Topic: Error with Login API on AbanteCart Storefront in ReactJS  (Read 7108 times)

Offline ubaid

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Error with Login API on AbanteCart Storefront in ReactJS
« 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.



Offline yonghan79

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +21/-0
    • View Profile
Re: Error with Login API on AbanteCart Storefront in ReactJS
« Reply #1 on: January 25, 2023, 10:40:25 AM »
Hi,

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


Offline ubaid

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Error with Login API on AbanteCart Storefront in ReactJS
« Reply #2 on: January 26, 2023, 07:27:34 AM »
Thanks for your reply. But still the problem is the same.

Offline yonghan79

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +21/-0
    • View Profile
Re: Error with Login API on AbanteCart Storefront in ReactJS
« Reply #3 on: January 26, 2023, 11:07:26 AM »
On params, you just need the rt. loginname, password, api_key(optional) should be in body.

Offline ubaid

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Error with Login API on AbanteCart Storefront in ReactJS
« Reply #4 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."
« Last Edit: January 31, 2023, 05:05:51 AM by ubaid »

 

Powered by SMFPacks Social Login Mod