A
A
ArtKV2019-03-12 05:27:23
Angular
ArtKV, 2019-03-12 05:27:23

How can you deny access to resources without authentication?

There is a project on Node.js + Angular, passport.js is used for authentication.
When starting a project, a page with authorization and registration is available to the user.
After successfully entering the site, redirection to the main content of the site occurs in the following way:
res.sendfile('./public/main.html');
In the address bar, the following is displayed: 127.0.0.1:2300/#!
Question: how to prevent direct access to main.html (and other pages) from the address bar if the user has not been authenticated?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Robur, 2019-03-12
@Robur

For example, as the documentation says: www.passportjs.org/docs/authorize
put this in static routes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question