title
Node.js With Passport Authentication | Full Project

description
In this video we will build a complete authentication app with login, register and access control using Node.js, Express, Passport, Mongoose and more. Sponsor: DevMountain Bootcamp https://goo.gl/6q0dEa Code: https://github.com/bradtraversy/node_passport_login 💖 Become a Patron: Show support & get perks! http://www.patreon.com/traversymedia Website & Udemy Courses http://www.traversymedia.com Follow Traversy Media: https://www.facebook.com/traversymedia https://www.twitter.com/traversymedia https://www.instagram.com/traversymedia Patron Resources: Carlos Mafla Channel - https://www.youtube.com/channel/UCnFRgYETwUg6eoeHACuVkcA ParkFlyer Explorer SEO - https://parkflyerexplorer.com Need Domains & Hosting? Inmotion Hosting - https://inmotion-hosting.evyy.net/c/396530/260033/4222 Namecheap - https://namecheap.pxf.io/c/1299552/386170/5618

detail
{'title': 'Node.js With Passport Authentication | Full Project', 'heatmap': [{'end': 765.283, 'start': 662.154, 'weight': 0.755}, {'end': 927.855, 'start': 865.615, 'weight': 0.976}, {'end': 1020.744, 'start': 964.05, 'weight': 1}, {'end': 2398.971, 'start': 2341.195, 'weight': 0.742}], 'summary': 'Learn how to develop a node.js & passport app with comprehensive web development guide, covering local strategy, mongodb usage, oauth for social media logins, ejs, mongoose, user model creation, registration setup, form validation, password hashing, flash messages, user authentication, and dashboard creation.', 'chapters': [{'end': 88.737, 'segs': [{'end': 44.357, 'src': 'embed', 'start': 7.059, 'weight': 0, 'content': [{'end': 8.92, 'text': 'this video is sponsored by devmountain.', 'start': 7.059, 'duration': 1.861}, {'end': 12.982, 'text': "if you're interested in learning web development, ios or ux design,", 'start': 8.92, 'duration': 4.062}, {'end': 18.965, 'text': 'devmountain is a 12-week design and development boot camp intended to get you a full-time position in the industry.', 'start': 12.982, 'duration': 5.983}, {'end': 22.567, 'text': 'to learn more, visit devmountain.com or click the link in the description below.', 'start': 18.965, 'duration': 3.602}, {'end': 23.808, 'text': "Hey, what's going on, guys?", 'start': 22.927, 'duration': 0.881}, {'end': 27.429, 'text': "So in this video we're going to create a Node.js and Passport app.", 'start': 23.848, 'duration': 3.581}, {'end': 31.191, 'text': 'And Passport is used for authentication of all types.', 'start': 27.749, 'duration': 3.442}, {'end': 37.154, 'text': "We have local strategy, which is what we'll be using, where we deal with the database directly.", 'start': 31.231, 'duration': 5.923}, {'end': 38.255, 'text': "We'll be using MongoDB.", 'start': 37.214, 'duration': 1.041}, {'end': 44.357, 'text': 'You can use OAuth, so Google, GitHub, Facebook, Twitter, you can use those to log in.', 'start': 39.315, 'duration': 5.042}], 'summary': 'Devmountain offers a 12-week boot camp for web development, ios, and ux design to secure full-time industry positions.', 'duration': 37.298, 'max_score': 7.059, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k7059.jpg'}, {'end': 94.819, 'src': 'embed', 'start': 66.266, 'weight': 1, 'content': [{'end': 72.349, 'text': "i don't really like doing the series because usually the first video gets a ton of views and then it just kind of falls off.", 'start': 66.266, 'duration': 6.083}, {'end': 74.21, 'text': "so i don't really like doing those.", 'start': 72.349, 'duration': 1.861}, {'end': 79.193, 'text': 'but um, this is a a redo of a series i did about three years ago.', 'start': 74.21, 'duration': 4.983}, {'end': 87.416, 'text': 'uh, for those of you that remember, i had a a node and passport application that I built and the code was just horrendous.', 'start': 79.193, 'duration': 8.223}, {'end': 88.737, 'text': 'I just updated it today.', 'start': 87.456, 'duration': 1.281}, {'end': 94.819, 'text': "And I think we all go through that when we look at our old code and it's just it's just cringe worthy.", 'start': 88.757, 'duration': 6.062}], 'summary': 'Redoing a series after 3 years due to poor initial code, a common experience for many developers.', 'duration': 28.553, 'max_score': 66.266, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k66266.jpg'}], 'start': 7.059, 'title': 'Creating a node.js & passport app', 'summary': 'Focuses on creating a comprehensive guide for web development using node.js and passport, covering local strategy for database interaction, usage of mongodb, oauth for various social media logins, and the usage of ejs and mongoose.', 'chapters': [{'end': 88.737, 'start': 7.059, 'title': 'Creating node.js & passport app', 'summary': 'Focuses on creating a node.js and passport app, covering local strategy for database interaction, usage of mongodb, oauth for various social media logins, and the usage of ejs and mongoose, aiming to provide a comprehensive guide for web development.', 'duration': 81.678, 'highlights': ['Passport is used for authentication, including local strategy for database interaction, MongoDB usage, OAuth for social media logins, and JSON web token for front-end frameworks like React or Vue.', 'Devmountain sponsors a 12-week design and development boot camp aiming to secure a full-time industry position.', 'The video covers a redo of a series previously created about three years ago, focusing on improving the code quality of the Node and Passport application.', 'The chapter emphasizes the dislike for video series due to declining viewership after the first video.']}], 'duration': 81.678, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k7059.jpg', 'highlights': ['Passport is used for authentication, including local strategy for database interaction, MongoDB usage, OAuth for social media logins, and JSON web token for front-end frameworks like React or Vue.', 'The video covers a redo of a series previously created about three years ago, focusing on improving the code quality of the Node and Passport application.', 'Devmountain sponsors a 12-week design and development boot camp aiming to secure a full-time industry position.', 'The chapter emphasizes the dislike for video series due to declining viewership after the first video.']}, {'end': 936.307, 'segs': [{'end': 135.978, 'src': 'embed', 'start': 109.068, 'weight': 2, 'content': [{'end': 117.114, 'text': 'And you can use this kind of as a boilerplate for for any application that you want to implement server side authentication with.', 'start': 109.068, 'duration': 8.046}, {'end': 120.775, 'text': "so let's say register and we're using bootstrap.", 'start': 117.734, 'duration': 3.041}, {'end': 128.395, 'text': "we're actually using boot swatch, which is a themed bootstrap file, and we're gonna just log in here or register.", 'start': 120.775, 'duration': 7.62}, {'end': 130.857, 'text': 'i think i actually already have myself registered.', 'start': 128.395, 'duration': 2.462}, {'end': 132.017, 'text': "so let's use a different name.", 'start': 130.857, 'duration': 1.16}, {'end': 135.978, 'text': "we'll say sam smith.", 'start': 132.017, 'duration': 3.961}], 'summary': 'Demonstrating server side authentication using bootstrap and boot swatch for registration.', 'duration': 26.91, 'max_score': 109.068, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k109068.jpg'}, {'end': 191.311, 'src': 'embed', 'start': 163.331, 'weight': 0, 'content': [{'end': 168.935, 'text': 'now this dashboard is protected, so you have to be logged in to actually get to this route.', 'start': 163.331, 'duration': 5.604}, {'end': 175.999, 'text': "so if i log out and i go to slash dashboard, you'll see that it doesn't let me.", 'start': 168.935, 'duration': 7.064}, {'end': 178.882, 'text': 'it just tells me i have to log in to view this resource.', 'start': 175.999, 'duration': 2.883}, {'end': 179.982, 'text': "so that's what we'll be building.", 'start': 178.882, 'duration': 1.1}, {'end': 182.625, 'text': 'guys, hopefully you enjoy this project.', 'start': 179.982, 'duration': 2.643}, {'end': 187.649, 'text': "we're going to jump into mongodb.com because we need to create our database.", 'start': 182.625, 'duration': 5.024}, {'end': 191.311, 'text': 'now you can download mongo and install it locally if you want.', 'start': 187.649, 'duration': 3.662}], 'summary': 'The dashboard is protected, requiring login; project involves building it; database creation on mongodb.com needed.', 'duration': 27.98, 'max_score': 163.331, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k163331.jpg'}, {'end': 231.988, 'src': 'embed', 'start': 203.283, 'weight': 1, 'content': [{'end': 210.321, 'text': "So if you go to get MongoDB, fill this out and just register and then hit log in and I'll go ahead and log in.", 'start': 203.283, 'duration': 7.038}, {'end': 222.984, 'text': "And the way that this works is you create what's called a cluster and you get one free cluster.", 'start': 218.422, 'duration': 4.562}, {'end': 224.525, 'text': "And I've already created mine.", 'start': 223.324, 'duration': 1.201}, {'end': 225.945, 'text': 'I called it test cluster one.', 'start': 224.545, 'duration': 1.4}, {'end': 229.347, 'text': "So if you don't have one yet, just hit build new cluster.", 'start': 226.705, 'duration': 2.642}, {'end': 231.988, 'text': 'Choose a WS for your provider.', 'start': 229.747, 'duration': 2.241}], 'summary': 'Get mongodb, register, create a free cluster, select a ws provider.', 'duration': 28.705, 'max_score': 203.283, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k203283.jpg'}, {'end': 431.7, 'src': 'embed', 'start': 401.57, 'weight': 3, 'content': [{'end': 405.092, 'text': "We're also going to need Mongoose to deal with MongoDB.", 'start': 401.57, 'duration': 3.522}, {'end': 409.454, 'text': "And we're going to use connect-flash for flash messaging.", 'start': 405.912, 'duration': 3.542}, {'end': 413.936, 'text': 'And connect-flash depends on express-session as well.', 'start': 410.074, 'duration': 3.862}, {'end': 419.331, 'text': "And I think, let me just make sure, I think that's everything that we need.", 'start': 414.488, 'duration': 4.843}, {'end': 421.173, 'text': 'Yeah, that should be everything.', 'start': 420.052, 'duration': 1.121}, {'end': 422.133, 'text': "So let's run that.", 'start': 421.233, 'duration': 0.9}, {'end': 424.295, 'text': 'And those are all going to get installed.', 'start': 422.634, 'duration': 1.661}, {'end': 426.536, 'text': "They're going to get added to our package.json.", 'start': 424.315, 'duration': 2.221}, {'end': 431.7, 'text': "Okay, now there's one dev dependency that I want to install, and that's nodemon.", 'start': 426.556, 'duration': 5.144}], 'summary': 'Installation of mongoose, connect-flash, express-session, and nodemon for the project.', 'duration': 30.13, 'max_score': 401.57, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k401570.jpg'}, {'end': 630.258, 'src': 'embed', 'start': 600.416, 'weight': 4, 'content': [{'end': 602.317, 'text': "So let's say const express.", 'start': 600.416, 'duration': 1.901}, {'end': 603.358, 'text': 'We need to bring that in.', 'start': 602.497, 'duration': 0.861}, {'end': 614.689, 'text': 'And then to use the express router, we need to create a variable called router and set that to express dot router.', 'start': 607.844, 'duration': 6.845}, {'end': 622.195, 'text': "And then let's do module dot exports equals router.", 'start': 616.232, 'duration': 5.963}, {'end': 630.258, 'text': "And then whenever we want to create a route, we simply say router dot and then whatever the method, in this case it's a get request.", 'start': 623.455, 'duration': 6.803}], 'summary': 'Using express to create a router for handling get requests.', 'duration': 29.842, 'max_score': 600.416, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k600416.jpg'}, {'end': 765.283, 'src': 'heatmap', 'start': 662.154, 'weight': 0.755, 'content': [{'end': 663.916, 'text': "Let's say app dot use slash.", 'start': 662.154, 'duration': 1.762}, {'end': 665.738, 'text': 'And I want that to pertain to.', 'start': 664.136, 'duration': 1.602}, {'end': 668.012, 'text': "Let's say require.", 'start': 666.991, 'duration': 1.021}, {'end': 671.775, 'text': "I want that to pertain to that index file that's in the routes folder.", 'start': 668.032, 'duration': 3.743}, {'end': 675.437, 'text': 'So dot slash routes slash index.', 'start': 671.855, 'duration': 3.582}, {'end': 681.822, 'text': 'OK, so now if we go back here and we reload, we should see the text welcome.', 'start': 676.878, 'duration': 4.944}, {'end': 685.904, 'text': "Okay, so let's see.", 'start': 683.723, 'duration': 2.181}, {'end': 690.047, 'text': 'We might as well just copy what we have in the index.js routes.', 'start': 686.184, 'duration': 3.863}, {'end': 698.631, 'text': "Go to users, paste that in, and let's do slash login, and we'll just send the text login.", 'start': 690.827, 'duration': 7.804}, {'end': 707.816, 'text': "So we'll say login page, and then let's just grab this.", 'start': 698.651, 'duration': 9.165}, {'end': 712.339, 'text': "Let's copy this down, and this will be the register page.", 'start': 708.537, 'duration': 3.802}, {'end': 718.119, 'text': 'So this will be slash register.', 'start': 714.898, 'duration': 3.221}, {'end': 727.083, 'text': 'OK, just to get the routes down for the just displaying the pages.', 'start': 718.139, 'duration': 8.944}, {'end': 736.487, 'text': "now in our app we're going to have to do the same thing for slash users, and we want that to pertain to routes slash users.", 'start': 727.083, 'duration': 9.404}, {'end': 749.3, 'text': 'OK, so now if I go to localhost 5000 slash users slash login, we get login, and if I go to slash register, we get register.', 'start': 737.347, 'duration': 11.953}, {'end': 758.222, 'text': "All right, so now that we've done that, let's start to set up our views so that we can actually see, you can actually create our UI.", 'start': 750.9, 'duration': 7.322}, {'end': 762.822, 'text': 'So we need to bring EJS into AppJS.', 'start': 759.182, 'duration': 3.64}, {'end': 764.143, 'text': "We actually don't need to bring it in.", 'start': 763.023, 'duration': 1.12}, {'end': 765.283, 'text': 'We need to initialize it.', 'start': 764.163, 'duration': 1.12}], 'summary': 'Setting up routes for login, register, and users in app.js.', 'duration': 103.129, 'max_score': 662.154, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k662154.jpg'}, {'end': 820.334, 'src': 'embed', 'start': 784.979, 'weight': 5, 'content': [{'end': 804.002, 'text': "so let's say ejs, we need to do app.use, express layouts and then we need to just do app.set and we need to set our view engine to E.J.S.", 'start': 784.979, 'duration': 19.023}, {'end': 808.205, 'text': "OK, and make sure this is above this or the layouts won't work.", 'start': 804.002, 'duration': 4.203}, {'end': 809.766, 'text': "OK, we'll save that.", 'start': 808.845, 'duration': 0.921}, {'end': 812.368, 'text': 'Now we need to create a folder for our views.', 'start': 810.286, 'duration': 2.082}, {'end': 820.334, 'text': "And inside views, we're going to have a file called layout dot E.J.S.", 'start': 814.71, 'duration': 5.624}], 'summary': 'Setting up ejs view engine and layout for express app.', 'duration': 35.355, 'max_score': 784.979, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k784979.jpg'}, {'end': 927.855, 'src': 'heatmap', 'start': 865.615, 'weight': 0.976, 'content': [{'end': 875.422, 'text': "so we'll do exclamation enter or tab and for the title we'll say node.js and passport app.", 'start': 865.615, 'duration': 9.807}, {'end': 878.665, 'text': "and like i said, we're going to be using boot swatch.", 'start': 875.422, 'duration': 3.243}, {'end': 884.589, 'text': "so let's head over to boot swatch dot com.", 'start': 878.665, 'duration': 5.924}, {'end': 888.111, 'text': 'And basically I mean you can pick from any of these themes.', 'start': 885.289, 'duration': 2.822}, {'end': 890.052, 'text': "I'm using this journal theme.", 'start': 888.491, 'duration': 1.561}, {'end': 892.794, 'text': 'So if I click download it gives us the CSS.', 'start': 890.452, 'duration': 2.342}, {'end': 895.495, 'text': "I'm just going to grab the link here and use that.", 'start': 892.854, 'duration': 2.641}, {'end': 902.579, 'text': "So let's let's go right here and say link paste that in.", 'start': 896.636, 'duration': 5.943}, {'end': 905.181, 'text': "We're also using font awesome.", 'start': 903.34, 'duration': 1.841}, {'end': 911.982, 'text': "So let's go to fontawesome.com and grab this.", 'start': 908.499, 'duration': 3.483}, {'end': 916.185, 'text': 'Put that right here.', 'start': 914.544, 'duration': 1.641}, {'end': 923.872, 'text': 'Okay, now we are going to use the flash messages.', 'start': 916.205, 'duration': 7.667}, {'end': 927.855, 'text': "I'm using dismissible alerts, the bootstrap dismissible alerts.", 'start': 923.892, 'duration': 3.963}], 'summary': 'Using node.js and passport app with bootswatch theme, font awesome, and bootstrap dismissible alerts.', 'duration': 62.24, 'max_score': 865.615, 'thumbnail': ''}], 'start': 88.757, 'title': 'Node.js authentication and setup', 'summary': 'Covers building a server-side authentication system using node.js and mongodb, including the implementation of registration, login, and protected dashboard functionality, alongside setting up a mongodb cluster on atlas and configuring various dependencies for an efficient development environment.', 'chapters': [{'end': 353.154, 'start': 88.757, 'title': 'Node.js authentication with mongodb', 'summary': 'Covers building a server-side authentication system using node.js and mongodb, including the implementation of a registration, login, and protected dashboard functionality, as well as the setup of a mongodb cluster on atlas with user and ip whitelist configuration.', 'duration': 264.397, 'highlights': ['The chapter covers building a server-side authentication system using Node.js and MongoDB The transcript revolves around the building of a server-side authentication system using Node.js and MongoDB, including the implementation of registration, login, and protected dashboard functionality.', 'Setting up a MongoDB cluster on Atlas with user and IP whitelist configuration The process of setting up a MongoDB cluster on Atlas is explained, including the creation of a cluster, addition of a user with read and write permissions to any database, and the configuration of IP whitelist.', 'Demonstrating the registration and login functionalities using Bootstrap and validation The transcript demonstrates the registration and login functionalities using Bootstrap and validation, allowing users to register with a unique name and email, and providing a protected dashboard upon successful login.']}, {'end': 936.307, 'start': 353.954, 'title': 'Setting up node.js and dependencies', 'summary': 'Covers installing and configuring various dependencies including express, bcrypt, passport, ejs, mongoose, connect-flash, and nodemon to create a node.js and passport app, enabling efficient development and handling of routes and views.', 'duration': 582.353, 'highlights': ['Installing and configuring various dependencies including Express, bcrypt, passport, EJS, Mongoose, connect-flash, and nodemon to create a Node.js and passport app. Express, bcrypt, passport, EJS, Mongoose, connect-flash, nodemon', 'Setting up routes for different pages and handling HTTP requests using Express router. Creating routes for different pages, using Express router', 'Configuring views using EJS, ExpressLayouts, and creating a layout file for the app. Configuring views with EJS, using ExpressLayouts, creating a layout file']}], 'duration': 847.55, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k88757.jpg', 'highlights': ['The chapter covers building a server-side authentication system using Node.js and MongoDB, including registration, login, and protected dashboard functionality.', 'Setting up a MongoDB cluster on Atlas with user and IP whitelist configuration.', 'Demonstrating registration and login functionalities using Bootstrap and validation.', 'Installing and configuring various dependencies including Express, bcrypt, passport, EJS, Mongoose, connect-flash, and nodemon.', 'Setting up routes for different pages and handling HTTP requests using Express router.', 'Configuring views using EJS, ExpressLayouts, and creating a layout file for the app.']}, {'end': 1607.602, 'segs': [{'end': 1020.744, 'src': 'heatmap', 'start': 964.05, 'weight': 1, 'content': [{'end': 969.032, 'text': 'is we use an angle bracket percent and then a hyphen and then the word body.', 'start': 964.05, 'duration': 4.982}, {'end': 972.119, 'text': 'And then we do percent and then angle bracket.', 'start': 969.676, 'duration': 2.443}, {'end': 977.485, 'text': "OK so that's going to basically output whatever view that should be output on that page.", 'start': 972.399, 'duration': 5.086}, {'end': 978.526, 'text': "So let's save this.", 'start': 977.565, 'duration': 0.961}, {'end': 981.289, 'text': 'And now if we go to welcome E.J.S.', 'start': 979.206, 'duration': 2.083}, {'end': 984.672, 'text': 'and just put an H1 in and say welcome.', 'start': 982.21, 'duration': 2.462}, {'end': 986.489, 'text': 'and save this.', 'start': 985.709, 'duration': 0.78}, {'end': 989.531, 'text': 'This is what we want to render for the the index page.', 'start': 986.91, 'duration': 2.621}, {'end': 992.593, 'text': 'Now remember we go to our routes index J.S.', 'start': 989.991, 'duration': 2.602}, {'end': 994.914, 'text': 'and we have the route for that page.', 'start': 992.713, 'duration': 2.201}, {'end': 1000.877, 'text': "So we're going to do res dot render and the view that we want to render is welcome.", 'start': 995.054, 'duration': 5.823}, {'end': 1009.502, 'text': 'OK So now if I go back to localhost 5000 we should see an H1 with welcome.', 'start': 1000.897, 'duration': 8.605}, {'end': 1011.263, 'text': 'All right.', 'start': 1011.002, 'duration': 0.261}, {'end': 1017.742, 'text': "So what I'm going to do now is I'm going to paste in the views.", 'start': 1011.323, 'duration': 6.419}, {'end': 1020.744, 'text': 'Now, if you want, you can go to the repository.', 'start': 1018.143, 'duration': 2.601}], 'summary': "Using ejs, rendered 'welcome' h1 on index page at localhost 5000.", 'duration': 56.694, 'max_score': 964.05, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k964050.jpg'}, {'end': 1116.289, 'src': 'embed', 'start': 1077.866, 'weight': 0, 'content': [{'end': 1080.708, 'text': 'What we want to do is render the register template.', 'start': 1077.866, 'duration': 2.842}, {'end': 1084.83, 'text': "So we'll go to our route, users.js.", 'start': 1081.248, 'duration': 3.582}, {'end': 1087.312, 'text': "Let's change this to render.", 'start': 1085.591, 'duration': 1.721}, {'end': 1090.314, 'text': 'And then this will render login.', 'start': 1087.332, 'duration': 2.982}, {'end': 1096.438, 'text': 'And then we want this one to res.render register.', 'start': 1090.935, 'duration': 5.503}, {'end': 1099.46, 'text': "Okay, so let's grab..", 'start': 1096.458, 'duration': 3.002}, {'end': 1106.92, 'text': "from the repository let's grab views register E.J.S.", 'start': 1102.136, 'duration': 4.784}, {'end': 1116.289, 'text': "and I'm going to just copy this and let's go to register E.J.S.", 'start': 1108.742, 'duration': 7.547}], 'summary': 'Rendering register template using users.js route for login and register views.', 'duration': 38.423, 'max_score': 1077.866, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k1077866.jpg'}, {'end': 1248.648, 'src': 'embed', 'start': 1214.191, 'weight': 1, 'content': [{'end': 1217.172, 'text': 'Basically the same thing, except it goes to the login route.', 'start': 1214.191, 'duration': 2.981}, {'end': 1222.414, 'text': 'Paste that in login EJS.', 'start': 1219.713, 'duration': 2.701}, {'end': 1224.515, 'text': "We'll get rid of the include for now.", 'start': 1223.014, 'duration': 1.501}, {'end': 1230.553, 'text': "But basically the same thing it's just getting submitted to users login.", 'start': 1226.69, 'duration': 3.863}, {'end': 1232.655, 'text': "So let's save that.", 'start': 1231.474, 'duration': 1.181}, {'end': 1235.898, 'text': 'And go back.', 'start': 1235.037, 'duration': 0.861}, {'end': 1241.102, 'text': 'OK Now we should be able to click the log in here.', 'start': 1235.918, 'duration': 5.184}, {'end': 1244.285, 'text': 'Good So now the register and log in pages both display.', 'start': 1241.262, 'duration': 3.023}, {'end': 1248.648, 'text': "We might as well do the dashboard while we're at it.", 'start': 1246.606, 'duration': 2.042}], 'summary': 'Adjustments made to login route in ejs, enabling display of register and login pages.', 'duration': 34.457, 'max_score': 1214.191, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k1214191.jpg'}, {'end': 1350.617, 'src': 'embed', 'start': 1313.153, 'weight': 2, 'content': [{'end': 1319.755, 'text': 'And actually, you know what? We need to create our config file, our config folder.', 'start': 1313.153, 'duration': 6.602}, {'end': 1320.475, 'text': "So let's do that.", 'start': 1319.855, 'duration': 0.62}, {'end': 1322.215, 'text': 'Create a folder called config.', 'start': 1320.555, 'duration': 1.66}, {'end': 1330.058, 'text': "And I'm going to store the Mongo string, the connection string in a file called Keys Dot J.S.", 'start': 1322.856, 'duration': 7.202}, {'end': 1335.615, 'text': "In keys.js, we're just going to say module.exports.", 'start': 1331.754, 'duration': 3.861}, {'end': 1338.295, 'text': 'And we just want to export an object.', 'start': 1336.495, 'duration': 1.8}, {'end': 1342.296, 'text': "And let's do Mongo URI.", 'start': 1339.155, 'duration': 3.141}, {'end': 1348.337, 'text': "And then we'll put our Mongo URI in here.", 'start': 1346.057, 'duration': 2.28}, {'end': 1350.617, 'text': "Let's see.", 'start': 1348.357, 'duration': 2.26}], 'summary': 'Creating a config folder to store mongo connection string in keys.js.', 'duration': 37.464, 'max_score': 1313.153, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k1313153.jpg'}], 'start': 936.587, 'title': 'Node.js, ejs, and mongodb setup', 'summary': 'Covers rendering views with node.js and ejs, implementing layout, displaying views, and rendering specific templates resulting in a visually appealing webpage with welcome message and registration form. it also includes setting up ejs views for registration, login, and dashboard, creating a database connection using mongoose with a user schema including name, email, password, and date fields, and connecting to mongodb.', 'chapters': [{'end': 1138.663, 'start': 936.587, 'title': 'Rendering views with node.js and ejs', 'summary': 'Covers rendering views with node.js and ejs, demonstrating the process of setting up layout, displaying views, and rendering specific templates, resulting in a visually appealing webpage with welcome message and registration form.', 'duration': 202.076, 'highlights': ['The chapter demonstrates the process of setting up layout, displaying views, and rendering specific templates with Node.js and EJS, resulting in a visually appealing webpage with welcome message and registration form.', 'The instructor explains the usage of EJS to output views by using angle bracket percent and hyphen, which enhances the understanding of rendering mechanisms with quantifiable data.', 'The tutorial provides a walkthrough on rendering a visually appealing webpage with a welcome message and a registration form, utilizing Bootstrap grid and markup, resulting in an engaging user interface.']}, {'end': 1607.602, 'start': 1139.263, 'title': 'Setting up views and database connection', 'summary': 'Covers setting up ejs views for registration, login, and dashboard, and creating a database connection using mongoose, including defining a user schema with name, email, password, and date fields, and connecting to mongodb.', 'duration': 468.339, 'highlights': ['Creating and integrating EJS views for registration, login, and dashboard The process involves pasting code into respective EJS files for registration, login, and dashboard, with a brief explanation of the purpose and function of each view.', 'Setting up the database connection using Mongoose and MongoDB The steps include creating a config folder, storing the Mongo connection string in a keys.js file, requiring the keys file in app.js, and connecting to MongoDB using Mongoose, with the use of new URL parser to avoid console complaints.', "Defining a user schema with name, email, password, and date fields The user schema is created using Mongoose, with fields for name, email, password, and date, each specifying the type and whether it's required, along with setting a default value for the date field."]}], 'duration': 671.015, 'thumbnail': '', 'highlights': ['The chapter demonstrates the process of setting up layout, displaying views, and rendering specific templates with Node.js and EJS, resulting in a visually appealing webpage with welcome message and registration form.', 'Creating and integrating EJS views for registration, login, and dashboard The process involves pasting code into respective EJS files for registration, login, and dashboard, with a brief explanation of the purpose and function of each view.', 'Setting up the database connection using Mongoose and MongoDB The steps include creating a config folder, storing the Mongo connection string in a keys.js file, requiring the keys file in app.js, and connecting to MongoDB using Mongoose, with the use of new URL parser to avoid console complaints.']}, {'end': 2122.419, 'segs': [{'end': 1668.146, 'src': 'embed', 'start': 1607.722, 'weight': 0, 'content': [{'end': 1611.444, 'text': 'So const user equals mongoose.model.', 'start': 1607.722, 'duration': 3.722}, {'end': 1614.024, 'text': 'Okay, we want to create a model from our schema.', 'start': 1611.464, 'duration': 2.56}, {'end': 1618.206, 'text': 'So we pass in the model name, which is user.', 'start': 1614.084, 'duration': 4.122}, {'end': 1620.546, 'text': 'And then we want to pass in our user schema.', 'start': 1618.366, 'duration': 2.18}, {'end': 1626.988, 'text': "And then we're just going to export this so that we can use it in other files.", 'start': 1621.707, 'duration': 5.281}, {'end': 1629.129, 'text': 'Okay, and that should do it.', 'start': 1628.169, 'duration': 0.96}, {'end': 1631.69, 'text': "So let's save this.", 'start': 1630.589, 'duration': 1.101}, {'end': 1635.053, 'text': 'And we can close that up.', 'start': 1633.892, 'duration': 1.161}, {'end': 1639.498, 'text': "Now, first thing we're going to work on is the registration.", 'start': 1636.775, 'duration': 2.723}, {'end': 1642.508, 'text': "Let's see.", 'start': 1641.707, 'duration': 0.801}, {'end': 1650.793, 'text': "Now, since we're getting data from the form, we need to add in our body parser middleware, which now is part of Express.", 'start': 1643.368, 'duration': 7.425}, {'end': 1658.459, 'text': "Before, we had to install body parser as a separate module, but now it's actually included with Express.", 'start': 1651.634, 'duration': 6.825}, {'end': 1663.342, 'text': "So let's put that right under the EJS middleware.", 'start': 1659.139, 'duration': 4.203}, {'end': 1668.146, 'text': 'OK, so we can simply say app.use.', 'start': 1663.362, 'duration': 4.784}], 'summary': 'Creating a user model using mongoose and setting up body parser middleware for registration.', 'duration': 60.424, 'max_score': 1607.722, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k1607722.jpg'}, {'end': 1727.81, 'src': 'embed', 'start': 1698.614, 'weight': 2, 'content': [{'end': 1705.801, 'text': "And remember, when we submit our registration form, it's going to make a post request to slash user slash register.", 'start': 1698.614, 'duration': 7.187}, {'end': 1709.045, 'text': "So let's say register handle.", 'start': 1706.242, 'duration': 2.803}, {'end': 1716.883, 'text': "We'll do router.post because we're handling a post request to users slash register.", 'start': 1710.919, 'duration': 5.964}, {'end': 1724.688, 'text': "We don't have to put in user because we're already in that file and we basically said, you know, connect users to this file.", 'start': 1716.903, 'duration': 7.785}, {'end': 1727.81, 'text': "So let's say slash register.", 'start': 1725.969, 'duration': 1.841}], 'summary': 'Registration form submits post request to /user/register.', 'duration': 29.196, 'max_score': 1698.614, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k1698614.jpg'}], 'start': 1607.722, 'title': 'User model creation, registration setup, form validation, and submission', 'summary': 'Covers creating a user model, setting up middleware for form data, handling post requests to register users, integrating body parser middleware with express, validating form input for name, email, and password, ensuring password match and length, handling form submission, and error rendering.', 'chapters': [{'end': 1781.589, 'start': 1607.722, 'title': 'User model creation and registration setup', 'summary': 'Focuses on creating a user model using mongoose, setting up middleware for getting data from a form, and handling post requests to register users, demonstrating the integration of body parser middleware with express and logging form data in the console.', 'duration': 173.867, 'highlights': ["Creating a user model using mongoose The chapter explains the process of creating a user model using mongoose, with the model name as 'user' and exporting it for use in other files.", "Setting up middleware for getting data from a form It discusses the integration of body parser middleware with Express for parsing form data, demonstrating the use of 'app.use' and 'express.urlencoded' to handle data from the form.", "Handling post requests to register users It demonstrates the handling of post requests to '/user/register' by using router.post in the 'users.js' file, logging form data in the console, and sending a response to test the form data retrieval."]}, {'end': 2122.419, 'start': 1781.689, 'title': 'Form validation and submission', 'summary': 'Covers the process of validating form input for name, email, and password, as well as ensuring password match and length, while also demonstrating how to handle form submission and error rendering.', 'duration': 340.73, 'highlights': ['The chapter covers the process of validating form input for name, email, and password The code demonstrates the validation process for required fields such as name and email, as well as the use of destructuring to extract variables from the request body.', 'Ensuring password match and length The code includes checks to ensure that the passwords match and are at least six characters long, with corresponding error messages for mismatch and insufficient length.', "Handling form submission and error rendering The process of handling form submission and error rendering is explained, including the use of 'res.render' to rerender the registration form and passing variables such as errors and data for display."]}], 'duration': 514.697, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k1607722.jpg', 'highlights': ["Creating a user model using mongoose with the model name as 'user'", 'Setting up middleware for getting data from a form using body parser middleware with Express', "Handling post requests to register users by using router.post in the 'users.js' file"]}, {'end': 3133.986, 'segs': [{'end': 2153.501, 'src': 'embed', 'start': 2122.459, 'weight': 2, 'content': [{'end': 2125.481, 'text': "So what we'll do is create a partial.", 'start': 2122.459, 'duration': 3.022}, {'end': 2129.605, 'text': "So in our views, we're going to create a folder called Partials.", 'start': 2126.242, 'duration': 3.363}, {'end': 2138.812, 'text': 'And all a partial is is just a piece of markup, you know, some HTML or whatever that we want to put inside of another template file.', 'start': 2130.325, 'duration': 8.487}, {'end': 2141.734, 'text': "So we're going to call this, let's say new file.", 'start': 2139.372, 'duration': 2.362}, {'end': 2146.276, 'text': "We'll call this messages dot E.J.S.", 'start': 2141.794, 'duration': 4.482}, {'end': 2148.818, 'text': 'OK And then inside messages.', 'start': 2146.276, 'duration': 2.542}, {'end': 2153.501, 'text': "We're going to check to see if errors exists.", 'start': 2150.418, 'duration': 3.083}], 'summary': 'Creating a partial in the partials folder for checking errors in messages.', 'duration': 31.042, 'max_score': 2122.459, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k2122459.jpg'}, {'end': 2258.827, 'src': 'embed', 'start': 2228.685, 'weight': 1, 'content': [{'end': 2242.835, 'text': "So we're going to say if type of which is just a JavaScript expression, we'll say if type of errors is not equal to undefined.", 'start': 2228.685, 'duration': 14.15}, {'end': 2247.517, 'text': 'Then that means that there is an error.', 'start': 2244.554, 'duration': 2.963}, {'end': 2250.299, 'text': 'Now, if there is an error, we want to display that.', 'start': 2248.097, 'duration': 2.202}, {'end': 2253.362, 'text': 'Right We actually want to loop through them because errors is an array.', 'start': 2250.399, 'duration': 2.963}, {'end': 2258.827, 'text': 'So in E.J.S., we can use a for each so we can do.', 'start': 2253.983, 'duration': 4.844}], 'summary': 'Using javascript to check for errors and loop through an array in e.j.s.', 'duration': 30.142, 'max_score': 2228.685, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k2228685.jpg'}, {'end': 2422.958, 'src': 'heatmap', 'start': 2341.195, 'weight': 0, 'content': [{'end': 2344.476, 'text': 'Let me just double check the syntax here.', 'start': 2341.195, 'duration': 3.281}, {'end': 2348.598, 'text': 'Yeah, so we just want to include.', 'start': 2347.017, 'duration': 1.581}, {'end': 2355.221, 'text': 'Partials slash and then messages.', 'start': 2351.479, 'duration': 3.742}, {'end': 2358.346, 'text': 'like that.', 'start': 2357.785, 'duration': 0.561}, {'end': 2360.688, 'text': 'that should work.', 'start': 2358.346, 'duration': 2.342}, {'end': 2362.53, 'text': "so let's, let's save it.", 'start': 2360.688, 'duration': 1.842}, {'end': 2368.738, 'text': "and of course, we could have just put this right inside register, but i'm going to be using this in in login as well.", 'start': 2362.53, 'duration': 6.208}, {'end': 2371.519, 'text': 'So a partial is.', 'start': 2369.738, 'duration': 1.781}, {'end': 2374.719, 'text': 'this is a good, you know, good time to use a partial.', 'start': 2371.519, 'duration': 3.2}, {'end': 2376.78, 'text': "So let's see.", 'start': 2375.84, 'duration': 0.94}, {'end': 2377.34, 'text': 'And there we go.', 'start': 2376.8, 'duration': 0.54}, {'end': 2379.12, 'text': 'Now, this looks like crap.', 'start': 2377.84, 'duration': 1.28}, {'end': 2382.321, 'text': 'I mean, we obviously want these on separate lines.', 'start': 2379.36, 'duration': 2.961}, {'end': 2385.862, 'text': 'I want to wrap them in the bootstrap alert markup.', 'start': 2382.401, 'duration': 3.461}, {'end': 2390.183, 'text': "So what I'm going to do is go to get bootstrap dot com.", 'start': 2386.922, 'duration': 3.261}, {'end': 2394.21, 'text': "because I can't remember the markup for the dismissible alert.", 'start': 2391.169, 'duration': 3.041}, {'end': 2398.971, 'text': "So we're going to go to components alerts and we want dismissing.", 'start': 2394.41, 'duration': 4.561}, {'end': 2401.792, 'text': 'OK, right here, because we want to be able to to exit out.', 'start': 2398.991, 'duration': 2.801}, {'end': 2404.612, 'text': "So what I'll do is just simply grab this.", 'start': 2402.472, 'duration': 2.14}, {'end': 2409.813, 'text': 'And inside of our messages.', 'start': 2407.673, 'duration': 2.14}, {'end': 2412.714, 'text': "here I'm going to replace this.", 'start': 2409.813, 'duration': 2.901}, {'end': 2422.958, 'text': "we'll put it back, but we want to put in our markup and we just want to replace this line with what was just here.", 'start': 2412.714, 'duration': 10.244}], 'summary': 'Configuring partials and implementing dismissible alert markup for messages.', 'duration': 81.763, 'max_score': 2341.195, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k2341195.jpg'}, {'end': 2593.677, 'src': 'embed', 'start': 2557.591, 'weight': 3, 'content': [{'end': 2562.613, 'text': "That's being what that's what's passed into the form and we want to match it to a user in the database.", 'start': 2557.591, 'duration': 5.022}, {'end': 2565.274, 'text': 'Now this is going to return a promise.', 'start': 2563.474, 'duration': 1.8}, {'end': 2567.455, 'text': "So we're going to say dot then.", 'start': 2565.554, 'duration': 1.901}, {'end': 2572.157, 'text': "And let's see.", 'start': 2567.475, 'duration': 4.682}, {'end': 2574.318, 'text': 'You know say dot then.', 'start': 2573.058, 'duration': 1.26}, {'end': 2577.96, 'text': "And that's going to give us the user.", 'start': 2576.299, 'duration': 1.661}, {'end': 2586.094, 'text': 'And what we want to do is check for that user.', 'start': 2580.832, 'duration': 5.262}, {'end': 2593.677, 'text': 'OK, so if there is a user, then what I want to do is basically the same thing we did here.', 'start': 2586.114, 'duration': 7.563}], 'summary': 'Matching form input to user in database, returning a promise.', 'duration': 36.086, 'max_score': 2557.591, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k2557591.jpg'}, {'end': 2708.348, 'src': 'embed', 'start': 2672.336, 'weight': 4, 'content': [{'end': 2676.518, 'text': 'bcrypt.js, not .js, just bcrypt.js.', 'start': 2672.336, 'duration': 4.182}, {'end': 2680.72, 'text': "Okay, and then let's go down.", 'start': 2678.619, 'duration': 2.101}, {'end': 2687.484, 'text': "And inside the else, we're going to say const new user.", 'start': 2680.74, 'duration': 6.744}, {'end': 2692.196, 'text': "And we're going to set this to new user.", 'start': 2688.792, 'duration': 3.404}, {'end': 2692.956, 'text': 'OK, When?', 'start': 2692.216, 'duration': 0.74}, {'end': 2697.481, 'text': 'when you have a model and you want to create a new instance or, in this case, a new user,', 'start': 2692.956, 'duration': 4.525}, {'end': 2702.546, 'text': 'we want to use the new keyword and then we want to pass in the values.', 'start': 2697.481, 'duration': 5.065}, {'end': 2704.188, 'text': 'So we want to pass in name.', 'start': 2702.686, 'duration': 1.502}, {'end': 2708.348, 'text': 'Email and password.', 'start': 2705.988, 'duration': 2.36}], 'summary': 'Using bcrypt.js to create a new user instance with name, email, and password.', 'duration': 36.012, 'max_score': 2672.336, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k2672336.jpg'}, {'end': 2907.462, 'src': 'embed', 'start': 2878.171, 'weight': 5, 'content': [{'end': 2881.872, 'text': 'So we have to use be crypt for this.', 'start': 2878.171, 'duration': 3.701}, {'end': 2888.034, 'text': 'And what we need to do is is generate a salt.', 'start': 2883.893, 'duration': 4.141}, {'end': 2890.974, 'text': 'We need to generate a salt so that we can create a hash.', 'start': 2888.374, 'duration': 2.6}, {'end': 2892.515, 'text': 'So be crypt.', 'start': 2891.515, 'duration': 1}, {'end': 2896.015, 'text': 'has a method called Jen salt.', 'start': 2893.513, 'duration': 2.502}, {'end': 2900.217, 'text': 'And this takes in basically the I forget what this is.', 'start': 2897.416, 'duration': 2.801}, {'end': 2907.462, 'text': "It's like the number of characters or if you want to look at the B-Crip documentation you can do that.", 'start': 2900.237, 'duration': 7.225}], 'summary': 'Use becrypt to generate a salt for hash creation.', 'duration': 29.291, 'max_score': 2878.171, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k2878171.jpg'}], 'start': 2122.459, 'title': 'Ejs partials, error handling, user registration, and password hashing', 'summary': 'Discusses creating partials in e.j.s, handling javascript errors, user registration with mongoose and bcrypt, and hashing passwords with bcrypt, providing insights into creating and using ejs partials, improving error display, ensuring secure user registration, and enhancing password security.', 'chapters': [{'end': 2203.869, 'start': 2122.459, 'title': 'Creating partials in e.j.s', 'summary': 'Discusses creating partials in e.j.s by creating a folder called partials, defining a new file named messages dot e.j.s, and using ejs syntax to check for the existence of errors in the template file, providing insights into the process of creating and using partials in e.j.s.', 'duration': 81.41, 'highlights': ['The process of creating a partial in E.J.S involves creating a folder called Partials and defining a new file named messages dot E.J.S.', 'Using EJS syntax to check for the existence of errors in the template file is similar to using JavaScript inside HTML, providing a seamless integration of logic and markup.']}, {'end': 2447.959, 'start': 2204.249, 'title': 'Handling javascript errors in ejs', 'summary': 'Covers handling javascript errors in ejs, including using if statements and looping through errors using foreach in javascript, resulting in improved error display and user experience.', 'duration': 243.71, 'highlights': ["Using if statements to check for JavaScript errors The speaker demonstrates using if statements to check for JavaScript errors by testing the type and ensuring that it's equal to undefined.", 'Looping through errors using forEach in JavaScript to display error messages The speaker explains the use of forEach in JavaScript to loop through errors, access the message property, and output it using EJS, enhancing the error display functionality.', 'Improving error display using Bootstrap alert markup The speaker discusses the process of improving error display by incorporating Bootstrap alert markup, resulting in a more visually appealing and user-friendly error presentation.']}, {'end': 2848.839, 'start': 2447.959, 'title': 'User registration and database interaction', 'summary': 'Covers the process of user registration, including password validation and database interaction using mongoose and bcrypt, with a focus on checking for existing users, encrypting passwords, and creating new user instances.', 'duration': 400.88, 'highlights': ['The process involves checking for existing users using the find one method, with a query to match the email to a user in the database, which returns a promise.', 'The chapter emphasizes the use of bcrypt for encrypting passwords and creating new user instances using the new keyword and passing in values such as name, email, and password.', 'The demonstration includes console logging the new user and using res.send to handle the response, showcasing the process of user registration and database interaction step by step.']}, {'end': 3133.986, 'start': 2848.959, 'title': 'Hashing user passwords with bcrypt', 'summary': 'Demonstrates the process of hashing user passwords using bcrypt, including generating a salt, creating a hash, and saving the hashed password, resulting in enhanced security and successful user registration.', 'duration': 285.027, 'highlights': ['The chapter demonstrates the process of hashing user passwords using Bcrypt It outlines the steps to generate a salt, create a hash, and save the hashed password for enhanced security.', 'The password should get hashed The demonstration emphasizes the successful hashing of the password, ensuring enhanced security for user registration.', "It redirected me to the user's login The redirection to the user's login page is mentioned, indicating the completion of user registration."]}], 'duration': 1011.527, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k2122459.jpg', 'highlights': ['Improving error display using Bootstrap alert markup The speaker discusses the process of improving error display by incorporating Bootstrap alert markup, resulting in a more visually appealing and user-friendly error presentation.', 'Looping through errors using forEach in JavaScript to display error messages The speaker explains the use of forEach in JavaScript to loop through errors, access the message property, and output it using EJS, enhancing the error display functionality.', 'The process of creating a partial in E.J.S involves creating a folder called Partials and defining a new file named messages dot E.J.S.', 'The process involves checking for existing users using the find one method, with a query to match the email to a user in the database, which returns a promise.', 'The chapter emphasizes the use of bcrypt for encrypting passwords and creating new user instances using the new keyword and passing in values such as name, email, and password.', 'The chapter demonstrates the process of hashing user passwords using Bcrypt It outlines the steps to generate a salt, create a hash, and save the hashed password for enhanced security.']}, {'end': 3577.334, 'segs': [{'end': 3190.983, 'src': 'embed', 'start': 3163.745, 'weight': 0, 'content': [{'end': 3168.449, 'text': 'it stores the message in a session and then displays it after the redirect.', 'start': 3163.745, 'duration': 4.704}, {'end': 3169.97, 'text': 'what we do here?', 'start': 3168.449, 'duration': 1.521}, {'end': 3176.954, 'text': "when we show messages, we're actually rendering a view and we're just passing this, these messages, in.", 'start': 3169.97, 'duration': 6.984}, {'end': 3179.216, 'text': "when you redirect, it's a different story.", 'start': 3176.954, 'duration': 2.262}, {'end': 3181.837, 'text': 'so we have to implement connect flash.', 'start': 3179.216, 'duration': 2.621}, {'end': 3183.779, 'text': 'okay, so that has its own middleware.', 'start': 3181.837, 'duration': 1.942}, {'end': 3190.983, 'text': 'so we have to go to app.js and it also needs express session, which we also installed.', 'start': 3183.779, 'duration': 7.204}], 'summary': 'Implement connect flash and express session in app.js for message storage and display.', 'duration': 27.238, 'max_score': 3163.745, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k3163745.jpg'}, {'end': 3302.86, 'src': 'embed', 'start': 3272.86, 'weight': 1, 'content': [{'end': 3276.662, 'text': 'If you wanna copy it from the repository, you can do that as well.', 'start': 3272.86, 'duration': 3.802}, {'end': 3282.953, 'text': "So after I use session secret, it doesn't matter what this is.", 'start': 3277.751, 'duration': 5.202}, {'end': 3286.214, 'text': "I'll just say secret resave.", 'start': 3282.973, 'duration': 3.241}, {'end': 3292.456, 'text': 'We actually want to set that to true and then save uninitialized.', 'start': 3287.194, 'duration': 5.262}, {'end': 3293.257, 'text': "We'll keep it true.", 'start': 3292.496, 'duration': 0.761}, {'end': 3295.077, 'text': "We don't need this cookie right here.", 'start': 3293.317, 'duration': 1.76}, {'end': 3300.399, 'text': "I'm not exactly sure what resave and save uninitialized is.", 'start': 3296.718, 'duration': 3.681}, {'end': 3302.86, 'text': 'I just know that this is the correct middleware.', 'start': 3300.459, 'duration': 2.401}], 'summary': "Middleware 'resave' and 'save uninitialized' set to true for session secret in repository.", 'duration': 30, 'max_score': 3272.86, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k3272860.jpg'}, {'end': 3422.653, 'src': 'embed', 'start': 3387.83, 'weight': 2, 'content': [{'end': 3397.793, 'text': 'we have this this flash object and then I want to pass in just success, underscore MSG like that.', 'start': 3387.83, 'duration': 9.963}, {'end': 3398.553, 'text': 'All right.', 'start': 3397.813, 'duration': 0.74}, {'end': 3409.876, 'text': "I'm going to do the same thing for error message except it's going to be locals error message.", 'start': 3398.593, 'duration': 11.283}, {'end': 3414.112, 'text': 'All right, and then we just need to call next.', 'start': 3411.894, 'duration': 2.218}, {'end': 3422.653, 'text': 'OK, so we just have a piece of custom middleware that has some global variables in it,', 'start': 3417.611, 'duration': 5.042}], 'summary': 'Custom middleware sets global variables for flash messages.', 'duration': 34.823, 'max_score': 3387.83, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k3387830.jpg'}, {'end': 3509.368, 'src': 'embed', 'start': 3483.444, 'weight': 4, 'content': [{'end': 3491.69, 'text': "Now the way that the success message is going to work this this global variable we created if it's not there it's just going to be an empty string.", 'start': 3483.444, 'duration': 8.246}, {'end': 3493.191, 'text': "So that's what we're going to check for.", 'start': 3491.79, 'duration': 1.401}, {'end': 3499.956, 'text': "So let's go under this and let's do let's do an if.", 'start': 3493.791, 'duration': 6.165}, {'end': 3509.368, 'text': "So we're going to say if, and then we should be able to just check for success,", 'start': 3503.846, 'duration': 5.522}], 'summary': 'The success message global variable will be checked for existence and set to an empty string if not present.', 'duration': 25.924, 'max_score': 3483.444, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k3483444.jpg'}], 'start': 3134.467, 'title': 'Implementing flash messages', 'summary': "Explains the implementation of flash messages using connect-flash and express-session middleware for redirects, emphasizing the need for setting 'secret' and 'resave' to true, and in middleware through global variables and custom middleware to ensure a seamless user experience.", 'chapters': [{'end': 3302.86, 'start': 3134.467, 'title': 'Implementing flash messages for redirects', 'summary': "Explains the process of implementing flash messages using connect-flash and express-session middleware to display a message after a redirect in a web application, emphasizing the need for setting 'secret' and 'resave' to true.", 'duration': 168.393, 'highlights': ['The chapter focuses on implementing flash messages to display a message after a redirect, by using connect-flash and express-session middleware.', "It emphasizes the need to set 'secret' and 'resave' to true in the express-session middleware for proper functioning.", "The process involves bringing in connect-flash and express-session, setting them as middleware in app.js, and configuring the 'secret' and 'resave' parameters to true for express-session."]}, {'end': 3577.334, 'start': 3306.021, 'title': 'Implementing flash messages in middleware', 'summary': 'Explains the implementation of flash messages in middleware using global variables and custom middleware, which allows the display of success and error messages when redirecting users, ensuring a seamless user experience.', 'duration': 271.313, 'highlights': ['The implementation of flash messages in middleware using global variables and custom middleware allows the display of success and error messages when redirecting users, ensuring a seamless user experience. Implementation of flash messages in middleware, use of global variables and custom middleware, display of success and error messages, seamless user experience', 'The use of custom middleware to set global variables for success and error messages facilitates the display of appropriate messages based on different conditions, such as registering and logging in. Use of custom middleware, setting global variables for success and error messages, displaying appropriate messages based on different conditions', 'The conditional check for the presence of a success message ensures that the message is displayed only when it is not an empty string, providing a user-friendly display of success messages. Conditional check for presence of success message, user-friendly display of success messages']}], 'duration': 442.867, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k3134467.jpg', 'highlights': ['The chapter focuses on implementing flash messages using connect-flash and express-session middleware.', "The need to set 'secret' and 'resave' to true in the express-session middleware is emphasized for proper functioning.", 'The implementation of flash messages in middleware using global variables and custom middleware allows the display of success and error messages when redirecting users, ensuring a seamless user experience.', 'The use of custom middleware to set global variables for success and error messages facilitates the display of appropriate messages based on different conditions, such as registering and logging in.', 'The conditional check for the presence of a success message ensures that the message is displayed only when it is not an empty string, providing a user-friendly display of success messages.']}, {'end': 4207.663, 'segs': [{'end': 3667.182, 'src': 'embed', 'start': 3638.363, 'weight': 6, 'content': [{'end': 3640.965, 'text': "I'm trying to think of the best way to teach this.", 'start': 3638.363, 'duration': 2.602}, {'end': 3645.207, 'text': "Let's close up everything just to kind of start from scratch here.", 'start': 3641.025, 'duration': 4.182}, {'end': 3648.488, 'text': "Now remember I said we're using a local strategy.", 'start': 3645.887, 'duration': 2.601}, {'end': 3654.331, 'text': "Now we have to put this inside of a config file and we're going to call this passport.", 'start': 3648.988, 'duration': 5.343}, {'end': 3659.778, 'text': "I mean, you don't have to put it in a config file, but I think it's the best way to do it.", 'start': 3655.515, 'duration': 4.263}, {'end': 3663.06, 'text': 'So inside here, we want to create our strategy.', 'start': 3660.558, 'duration': 2.502}, {'end': 3667.182, 'text': "So we're going to say const and we're going to call this local strategy.", 'start': 3663.08, 'duration': 4.102}], 'summary': 'Teaching a local strategy by putting it inside a config file', 'duration': 28.819, 'max_score': 3638.363, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k3638363.jpg'}, {'end': 3716.839, 'src': 'embed', 'start': 3690.276, 'weight': 2, 'content': [{'end': 3699.461, 'text': "OK, so we're bringing in the local strategy and then we're also going to bring in Mongoose, because we're logging in,", 'start': 3690.276, 'duration': 9.185}, {'end': 3702.142, 'text': 'which means we need to check to see if the email matches.', 'start': 3699.461, 'duration': 2.681}, {'end': 3703.183, 'text': 'the password matches.', 'start': 3702.142, 'duration': 1.041}, {'end': 3705.083, 'text': "So we're going to be using Mongoose for that.", 'start': 3703.203, 'duration': 1.88}, {'end': 3707.905, 'text': "So we'll require Mongoose.", 'start': 3705.163, 'duration': 2.742}, {'end': 3716.839, 'text': 'All right, and then we also wanna bring in bcrypt because we need to decrypt the hash to make sure that the passwords match.', 'start': 3710.196, 'duration': 6.643}], 'summary': 'Local strategy and mongoose used to validate email and password; bcrypt for decrypting hashes.', 'duration': 26.563, 'max_score': 3690.276, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k3690276.jpg'}, {'end': 3863.196, 'src': 'embed', 'start': 3833.536, 'weight': 1, 'content': [{'end': 3837.198, 'text': 'So basically the first thing we need to do is match the user.', 'start': 3833.536, 'duration': 3.662}, {'end': 3843.56, 'text': "We wanna first check to see if there's an email in the database that whatever they pass in.", 'start': 3837.238, 'duration': 6.322}, {'end': 3844.981, 'text': 'is there an email with that?', 'start': 3843.56, 'duration': 1.421}, {'end': 3847.222, 'text': "or, I'm sorry, is there a user with that email?", 'start': 3844.981, 'duration': 2.241}, {'end': 3849.323, 'text': "So let's say match.", 'start': 3848.262, 'duration': 1.061}, {'end': 3851.773, 'text': 'user All right.', 'start': 3850.453, 'duration': 1.32}, {'end': 3854.634, 'text': 'So the way that we can do this is by using Mongoose.', 'start': 3851.893, 'duration': 2.741}, {'end': 3863.196, 'text': "We'll do find one just like we did with the validation and we'll say see if there's an email that matches this email.", 'start': 3854.674, 'duration': 8.522}], 'summary': "Using mongoose, we need to match the user's email in the database.", 'duration': 29.66, 'max_score': 3833.536, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k3833536.jpg'}, {'end': 4003.902, 'src': 'embed', 'start': 3947.894, 'weight': 4, 'content': [{'end': 3955.402, 'text': "OK So that's what we want to happen if the user is not there.", 'start': 3947.894, 'duration': 7.508}, {'end': 3958.265, 'text': "If it is there then we're going to keep going.", 'start': 3956.423, 'duration': 1.842}, {'end': 3962.95, 'text': "Now we haven't dealt with the password yet.", 'start': 3960.167, 'duration': 2.783}, {'end': 3965.173, 'text': "We've only matched the user email.", 'start': 3962.99, 'duration': 2.183}, {'end': 3969.157, 'text': 'So obviously the next thing we want to do is match the password.', 'start': 3965.233, 'duration': 3.924}, {'end': 3977.202, 'text': 'Now to do that we need to use be crypt because the password in the database is hashed the password they submit is not.', 'start': 3970.578, 'duration': 6.624}, {'end': 3984.986, 'text': "So we're going to take be crypt and we're going to call a method called compare,", 'start': 3977.862, 'duration': 7.124}, {'end': 3991.169, 'text': 'and this actually takes in the password which is going to be passed right here.', 'start': 3984.986, 'duration': 6.183}, {'end': 4001.58, 'text': 'OK, So we want to take that password and then we want to take the user dot password, which is the hashed password, because, remember,', 'start': 3991.189, 'duration': 10.391}, {'end': 4003.902, 'text': 'this user is coming from the database right.', 'start': 4001.58, 'duration': 2.322}], 'summary': 'Matching user email and hashing password using be crypt method.', 'duration': 56.008, 'max_score': 3947.894, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k3947894.jpg'}, {'end': 4207.663, 'src': 'embed', 'start': 4183.587, 'weight': 0, 'content': [{'end': 4190.412, 'text': "if authentication succeeds, a session will be established and maintained via a cookie set in the user's browser.", 'start': 4183.587, 'duration': 6.825}, {'end': 4200.438, 'text': 'Each subsequent request will not contain credentials, but rather the unique cookie that identifies the session in order to support login sessions.', 'start': 4191.491, 'duration': 8.947}, {'end': 4206.642, 'text': 'Passport will serialize and deserialize user instances to and from the session.', 'start': 4200.838, 'duration': 5.804}, {'end': 4207.663, 'text': "So that's what this does.", 'start': 4206.703, 'duration': 0.96}], 'summary': 'Successful authentication establishes and maintains a session via a cookie, enabling subsequent requests without credentials, and passport serializes user instances for session management.', 'duration': 24.076, 'max_score': 4183.587, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k4183587.jpg'}], 'start': 3577.334, 'title': 'User authentication process', 'summary': 'Covers user authentication process, including passport configuration, use of mongoose and bcrypt for user authentication, and implementation of serialize and deserialize methods for user authentication with passport.', 'chapters': [{'end': 3947.874, 'start': 3577.334, 'title': 'Passport configuration and local strategy', 'summary': 'Covers the implementation of passport configuration for local strategy, including the use of mongoose and bcrypt for user authentication, with a demonstration of matching email and password in the database.', 'duration': 370.54, 'highlights': ['The chapter covers the implementation of passport configuration for local strategy It discusses the process of setting up passport configuration for local strategy, which involves creating a config file and defining a strategy for user authentication using passport.', 'Demonstration of matching email and password in the database using Mongoose The transcript demonstrates the use of Mongoose to find a user based on the provided email and handle the scenario if no user is found, showcasing the process of matching email and password in the database.', 'Inclusion of bcrypt for decrypting the hash to ensure password matches The inclusion of bcrypt for decrypting the hash is mentioned, indicating its role in ensuring that the passwords match during the user authentication process.']}, {'end': 4207.663, 'start': 3947.894, 'title': 'User authentication process', 'summary': 'Explains the user authentication process, including matching the password, using bcrypt to hash the password, comparing hashed and plain text passwords, and implementing serialize and deserialize methods for user authentication with passport.', 'duration': 259.769, 'highlights': ['Implementing serialize and deserialize methods for user authentication with Passport The chapter discusses the importance of serializing and deserializing user instances for user authentication with Passport.', 'Comparing hashed and plain text passwords using bcrypt The chapter explains the process of comparing hashed and plain text passwords using the bcrypt method to ensure secure user authentication.', 'Matching the password and using bcrypt to hash the password The chapter highlights the importance of matching the password and using bcrypt to hash the password for secure user authentication.']}], 'duration': 630.329, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k3577334.jpg', 'highlights': ['Covers user authentication process, including passport configuration, use of mongoose and bcrypt for user authentication, and implementation of serialize and deserialize methods for user authentication with passport.', 'Demonstration of matching email and password in the database using Mongoose The transcript demonstrates the use of Mongoose to find a user based on the provided email and handle the scenario if no user is found, showcasing the process of matching email and password in the database.', 'Inclusion of bcrypt for decrypting the hash to ensure password matches The inclusion of bcrypt for decrypting the hash is mentioned, indicating its role in ensuring that the passwords match during the user authentication process.', 'Implementing serialize and deserialize methods for user authentication with Passport The chapter discusses the importance of serializing and deserializing user instances for user authentication with Passport.', 'Comparing hashed and plain text passwords using bcrypt The chapter explains the process of comparing hashed and plain text passwords using the bcrypt method to ensure secure user authentication.', 'Matching the password and using bcrypt to hash the password The chapter highlights the importance of matching the password and using bcrypt to hash the password for secure user authentication.', 'The chapter covers the implementation of passport configuration for local strategy It discusses the process of setting up passport configuration for local strategy, which involves creating a config file and defining a strategy for user authentication using passport.']}, {'end': 5095.165, 'segs': [{'end': 4319.378, 'src': 'embed', 'start': 4280.168, 'weight': 0, 'content': [{'end': 4288.654, 'text': "between that and the flash we'll say passport middleware.", 'start': 4280.168, 'duration': 8.486}, {'end': 4289.995, 'text': "okay, that's that.", 'start': 4288.654, 'duration': 1.341}, {'end': 4293.69, 'text': 'now Passport is not defined.', 'start': 4289.995, 'duration': 3.695}, {'end': 4302.353, 'text': "So basically, now this is initializing our local strategy, right? And it's telling us passport is not defined.", 'start': 4294.331, 'duration': 8.022}, {'end': 4311.296, 'text': 'Because we actually need to require this file in our app.js.', 'start': 4307.355, 'duration': 3.941}, {'end': 4313.417, 'text': 'And we need to pass in passport.', 'start': 4311.376, 'duration': 2.041}, {'end': 4315.877, 'text': "So let's go up top.", 'start': 4314.457, 'duration': 1.42}, {'end': 4319.378, 'text': "And we'll go right up to the top here.", 'start': 4317.178, 'duration': 2.2}], 'summary': 'Initializing local strategy for passport middleware, requiring file in app.js', 'duration': 39.21, 'max_score': 4280.168, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k4280168.jpg'}, {'end': 4495.51, 'src': 'embed', 'start': 4455.222, 'weight': 2, 'content': [{'end': 4457.343, 'text': "All right, so let's go ahead and do that.", 'start': 4455.222, 'duration': 2.121}, {'end': 4466.147, 'text': "Okay, so let's say passport.authenticate.", 'start': 4457.363, 'duration': 8.784}, {'end': 4469.769, 'text': "We're using the local strategy.", 'start': 4467.588, 'duration': 2.181}, {'end': 4475.557, 'text': "Pass in local and we're going to pass in some parameters here.", 'start': 4470.694, 'duration': 4.863}, {'end': 4477.719, 'text': 'I want to do a success redirect.', 'start': 4475.577, 'duration': 2.142}, {'end': 4482.962, 'text': 'So on success, what do we want to do? We want to get redirect to slash dashboard.', 'start': 4478.479, 'duration': 4.483}, {'end': 4486.805, 'text': 'All right.', 'start': 4482.982, 'duration': 3.823}, {'end': 4488.046, 'text': 'Failure redirect.', 'start': 4486.985, 'duration': 1.061}, {'end': 4491.768, 'text': 'We want to go back to the login page.', 'start': 4489.266, 'duration': 2.502}, {'end': 4495.51, 'text': 'So slash users slash login.', 'start': 4491.848, 'duration': 3.662}], 'summary': 'Configuring passport local strategy for login and redirects.', 'duration': 40.288, 'max_score': 4455.222, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k4455222.jpg'}, {'end': 4670.494, 'src': 'embed', 'start': 4639.861, 'weight': 5, 'content': [{'end': 4651.536, 'text': "OK so we have Brad at Gmail is an actual user so let's do Brad at Gmail but let's do the wrong password and we get password incorrect.", 'start': 4639.861, 'duration': 11.675}, {'end': 4656.663, 'text': "All right so let's do Brad at Gmail and let's do the correct password.", 'start': 4652.938, 'duration': 3.725}, {'end': 4663.348, 'text': 'and log in and we get redirected to the dashboard.', 'start': 4659.745, 'duration': 3.603}, {'end': 4667.892, 'text': "Now we haven't created that route yet, but the login system is is working.", 'start': 4663.388, 'duration': 4.504}, {'end': 4669.373, 'text': 'The registration is working.', 'start': 4668.112, 'duration': 1.261}, {'end': 4670.494, 'text': 'The login is working.', 'start': 4669.413, 'duration': 1.081}], 'summary': 'Login and registration systems are working for user brad at gmail.', 'duration': 30.633, 'max_score': 4639.861, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k4639861.jpg'}, {'end': 4776.817, 'src': 'embed', 'start': 4731.819, 'weight': 4, 'content': [{'end': 4739.763, 'text': "So in our routes users, J.S., let's go down here and let's say log out handle.", 'start': 4731.819, 'duration': 7.944}, {'end': 4745.826, 'text': "And let's say router don't get.", 'start': 4742.524, 'duration': 3.302}, {'end': 4749.46, 'text': 'Log out.', 'start': 4748.909, 'duration': 0.551}, {'end': 4758.81, 'text': 'All right.', 'start': 4758.59, 'duration': 0.22}, {'end': 4762.812, 'text': 'Now logging out is actually very easy.', 'start': 4758.97, 'duration': 3.842}, {'end': 4767.353, 'text': 'All we have to do is call request dot logo using the passport middleware.', 'start': 4762.872, 'duration': 4.481}, {'end': 4769.094, 'text': 'It gives us the logo function.', 'start': 4767.413, 'duration': 1.681}, {'end': 4770.454, 'text': 'We can just do that.', 'start': 4769.554, 'duration': 0.9}, {'end': 4774.736, 'text': 'But I do want to send a flash message and redirect.', 'start': 4771.515, 'duration': 3.221}, {'end': 4776.817, 'text': "So I'm going to say request dot flash.", 'start': 4774.776, 'duration': 2.041}], 'summary': 'Creating a logout route in j.s., using passport middleware for flash message and redirect', 'duration': 44.998, 'max_score': 4731.819, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k4731819.jpg'}, {'end': 4857.571, 'src': 'embed', 'start': 4816.917, 'weight': 3, 'content': [{'end': 4822.859, 'text': "I can go to dashboard even though I'm not logged in which we need to fix.", 'start': 4816.917, 'duration': 5.942}, {'end': 4828.021, 'text': 'So what we need to do is implement ensure authenticated.', 'start': 4822.999, 'duration': 5.022}, {'end': 4835.703, 'text': "So let's go and let's create inside config a file called off dot J.S.", 'start': 4828.481, 'duration': 7.222}, {'end': 4838.783, 'text': 'OK, so this is like an off guard.', 'start': 4837.162, 'duration': 1.621}, {'end': 4857.571, 'text': "so let's say module dot exports equals an object called and then we're going to have a property here called ensure authenticated or a function called ensure authenticated and say function.", 'start': 4838.783, 'duration': 18.788}], 'summary': "Implement 'ensure authenticated' function to fix dashboard access issue.", 'duration': 40.654, 'max_score': 4816.917, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6FOq4cUdH8k/pics/6FOq4cUdH8k4816917.jpg'}], 'start': 4207.683, 'title': 'User authentication and dashboard creation', 'summary': 'Covers implementing passport middleware for user authentication, creating a dashboard, and log out functionality, including handling error messages, using express.js and passport middleware, ensuring user authentication and passing user data to the dashboard view.', 'chapters': [{'end': 4606.293, 'start': 4207.683, 'title': 'Implementing passport middleware for user authentication', 'summary': 'Covers implementing passport middleware for user authentication, including adding lines of middleware, handling errors, defining routes, and setting up flash messages for authentication failure.', 'duration': 398.61, 'highlights': ['The chapter covers implementing passport middleware for user authentication, including adding lines of middleware, handling errors, defining routes, and setting up flash messages for authentication failure.', 'The chapter discusses adding lines of middleware passport.initialize and passport.session inside app.js after the express session middleware.', 'The chapter explains the process of handling errors and defining routes for user authentication, utilizing passport.authenticate and setting up flash messages for authentication failure.', 'The chapter emphasizes the importance of placing the passport middleware in the correct order, ensuring successful implementation for user authentication.', 'The chapter demonstrates the use of passport.authenticate to handle local strategy authentication, specifying success and failure redirects, and setting up flash messages for authentication failure.']}, {'end': 5095.165, 'start': 4607.434, 'title': 'User authentication and dashboard creation', 'summary': 'Covers the implementation of user authentication, creation of a dashboard, and log out functionality, including handling of error messages and redirection, using express.js and passport middleware, with specific focus on ensuring user authentication and passing user data to the dashboard view.', 'duration': 487.731, 'highlights': ['The login system and registration are working, requiring only the creation of the dashboard and log out functionalities. The login system and registration are functional, with only the dashboard and log out features left to be implemented.', 'Implementation of log out functionality using Passport middleware, including flash message and redirection upon logging out. The log out functionality is implemented using Passport middleware, including a flash message upon logging out and redirection to the login page.', 'Creation of an authentication guard to ensure authenticated access to protected routes, with the ability to pass user data to the dashboard view. An authentication guard is created to ensure authenticated access to protected routes, allowing the passing of user data to the dashboard view.']}], 'duration': 887.482, 'thumbnail': '', 'highlights': ['The chapter covers implementing passport middleware for user authentication, including adding lines of middleware, handling errors, defining routes, and setting up flash messages for authentication failure.', 'The chapter emphasizes the importance of placing the passport middleware in the correct order, ensuring successful implementation for user authentication.', 'The chapter demonstrates the use of passport.authenticate to handle local strategy authentication, specifying success and failure redirects, and setting up flash messages for authentication failure.', 'Creation of an authentication guard to ensure authenticated access to protected routes, with the ability to pass user data to the dashboard view.', 'Implementation of log out functionality using Passport middleware, including flash message and redirection upon logging out.', 'The login system and registration are working, requiring only the creation of the dashboard and log out functionalities.']}], 'highlights': ['Passport is used for authentication, including local strategy for database interaction, MongoDB usage, OAuth for social media logins, and JSON web token for front-end frameworks like React or Vue.', 'The chapter covers building a server-side authentication system using Node.js and MongoDB, including registration, login, and protected dashboard functionality.', 'The chapter demonstrates the process of setting up layout, displaying views, and rendering specific templates with Node.js and EJS, resulting in a visually appealing webpage with welcome message and registration form.', "Creating a user model using mongoose with the model name as 'user'", 'Improving error display using Bootstrap alert markup The speaker discusses the process of improving error display by incorporating Bootstrap alert markup, resulting in a more visually appealing and user-friendly error presentation.', 'The chapter focuses on implementing flash messages using connect-flash and express-session middleware.', 'Covers user authentication process, including passport configuration, use of mongoose and bcrypt for user authentication, and implementation of serialize and deserialize methods for user authentication with passport.', 'The chapter covers implementing passport middleware for user authentication, including adding lines of middleware, handling errors, defining routes, and setting up flash messages for authentication failure.']}