Answer the question
In order to leave comments, you need to log in
How to properly redirect to Node.js?
The user enters the main page, the server checks whether he is authorized, if not, then you need to redirect to the /login page. How can this be done without js instructions on the client? Maybe some headings?
Or do you need to provide a script on the client in advance, and with the appropriate command from the server, make a redirect with a client javascript?
Answer the question
In order to leave comments, you need to log in
Create a checkuser endpoint on the back or request an accesstoken. According to the results that came with the API, make a redirect on the client side, it will be more correct.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question