L
L
lazuren2019-09-29 19:41:27
API
lazuren, 2019-09-29 19:41:27

How to log in via API?

There is a custom API (based on Opencart) on the api.site.loc subdomain and there is a React application on the main site.loc domain.
Everything turned out well and worked, getting categories, products, registering new users, and so on ... But exactly until that moment, authorization was not touched. I send a POST email/password from site.loc, it returns true, everything seems to be fine, but what to do next is not clear ..... In Opencart, this is not reflected in any way, a session for site.loc is not created.
Could you tell me how to implement authorization?
Preferably in the context of Opencart and React, without OAuth and OpenID.......

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lazuren, 2020-05-18
@lazuren

I figured out this issue myself. HTTP Request and response headers must contain the withCredentials header

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question