Answer the question
In order to leave comments, you need to log in
How to set up FE (localhost) to BE (remote server) interaction with withCredentials?
It is necessary to send a request from the local machine to the remote server/hosting.
The method is called by the POST method to the url: https://site.ru/v1/auth/login
At the moment, the request is not made due to a CORS error.
Headers (php):
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Origin: '.$_SERVER['HTTP_ORIGIN']);
header('Access-Control-Allow-Methods: *');
header('Access-Control-Allow-Headers: *');
Answer the question
In order to leave comments, you need to log in
Usually, authorization returns a token (for example, in the form of a JWT) that is passed to the frontend, the frontend verifies the token by verifying the signature or a server side request and sets the cookie.
You can change it so that there is always at least one .current element
Or check for zero if($(".tabs-home__nav__item a.current").lenght == 0) and substitute some default value.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question