Learn how to protect routes in the Vue.js application.
- [Narrator] In this video … we're going to be talking about … Navigation Guards for Vue.js Router. … So, Navigation Guards basically protect routes, … either by redirecting or canceling. … So you basically give it a function, … you check for whatever it is you want, … and then you take an action based on that. … And you could implement them in a application level, … on a single route or inside Vue.js components. … In this current state, … the application allows you to route to any route, … and none of the routes are protected by Guards. … And so what we want to do is … make sure that users have to be logged in … before they can start creating or viewing task. … So let's go into the application … and go into your source folder, … and then into your router config. … And then let's save this router object here to a variable, … we'll just name it routes. … That way we can access its properties and methods. … Then I'll just export down here at the bottom, … export default routes. … So now I can type in routes dot …
- Single-page applications and Vue.js
- Preparing your development environment
- Creating a Vue.js application
- Using the Vue.js router
- Building a RESTful back-end API with Node.js and Express.js
- Connecting to MongoDB
- Validating and managing a user session
- Connecting Vue.js to a back-end server
Skill Level Intermediate
1. Getting to Know the MEVN Stack
2. Preparing Your Development Environment
3. Vue.js Core Concepts
4. Building a RESTful Back-End API with Node.js and Express.js
Check HTTP status codes3m 17s
5. Connecting Your Application to MongoDB
6. User Authentication, JWTs, and Session Management
7. Finalizing Your Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.