M
M
Maxim2021-09-16 12:26:09
Node.js
Maxim, 2021-09-16 12:26:09

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

1 answer(s)
D
Daniel Chistyakov, 2021-09-16
@max_shane

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 question

Ask a Question

731 491 924 answers to any question