From the course: Node: Authentication
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Securing routes
- Most applications that deal with authenticated users, they're routes that only should be accessible if a user is logged in. In our case we were careless, and did not secure the my account route. And while, in this particular case, this just triggers an error and does not give us access to restricted functionality, it is still something that needs to be avoided by any means. Imagine you bookmark this page and your login session expired, and this is what you get when you try to access it again. In this video, we will add a little helper middleware that sends the user to the login form when they try to access a page without being logged in. Plus, we will try to redirect the user to the page they tried to access in the first place if the login was successful. So let's head into wishes for the code and then we now install this helper. So I terminate the node process by pressing Control C in the console, and then I install in…
Contents
-
-
-
-
-
Using Passport.js for authentication1m 55s
-
(Locked)
Implementing local authentication with Passport.js16m 18s
-
(Locked)
Securing routes4m 24s
-
(Locked)
Set up and understand the ToDo list sample application6m 9s
-
(Locked)
Authenticating API calls8m 5s
-
(Locked)
Creating and sending JWT tokens8m 3s
-
(Locked)
Implementing JWT authentication with passport15m 29s
-
(Locked)
Ensuring object level authorization4m 25s
-
-
-