Answer the question
In order to leave comments, you need to log in
How to make a request on the first visit to the client?
Here is an example, let's say there are secure pages that only an authorized user can access. I don't need to make a request to the server every time I go to secure pages, I need to make a request if the client has entered the secure channel for the first time.
There is an idea to implement the canActivate service, check cookies, if they are not there, make a request to the server to check authorization, receive a response from the server and write data about the first visit to the server in cookies.
If the session ends, then the cookies disappear accordingly.
Are there any easier options?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question