1 00:00:00,930 --> 00:00:01,763 -: All right my friends, 2 00:00:01,763 --> 00:00:03,630 I think our project is really coming together here. 3 00:00:03,630 --> 00:00:06,420 Let's do a quick wrap up in this section. 4 00:00:06,420 --> 00:00:07,500 I'm gonna first start inside 5 00:00:07,500 --> 00:00:09,960 of our Action creator's file. 6 00:00:09,960 --> 00:00:12,120 Inside of here we learned a lot of interesting things 7 00:00:12,120 --> 00:00:14,430 around working with Redux Thunk. 8 00:00:14,430 --> 00:00:16,530 I wanna specifically point out the fact 9 00:00:16,530 --> 00:00:18,030 that when we make use of Redux Thunk, 10 00:00:18,030 --> 00:00:21,510 you will frequently see it with this abbreviated syntax. 11 00:00:21,510 --> 00:00:24,480 Remember when we have this arrow function right here 12 00:00:24,480 --> 00:00:27,000 all it means is that we've got one function 13 00:00:27,000 --> 00:00:28,863 that's returning another function. 14 00:00:29,700 --> 00:00:32,460 The child function gets called with that dispatch method. 15 00:00:32,460 --> 00:00:35,460 And dispatch allows us to manually send any number 16 00:00:35,460 --> 00:00:38,940 of actions we want to into our Redux store. 17 00:00:38,940 --> 00:00:41,100 When we call dispatch and pass into action 18 00:00:41,100 --> 00:00:42,150 the action gets sent to all 19 00:00:42,150 --> 00:00:43,980 of our middlewares and then forwarded 20 00:00:43,980 --> 00:00:46,353 on to all the reducers in our application. 21 00:00:47,580 --> 00:00:49,800 Inside of our signup Action creator, 22 00:00:49,800 --> 00:00:53,640 we make use of local storage to store the JSON web token 23 00:00:53,640 --> 00:00:56,130 that we got back from our API. 24 00:00:56,130 --> 00:00:58,710 Now, one thing I wanna mention about local storage. 25 00:00:58,710 --> 00:01:02,220 It's kind of undecided in the web development community 26 00:01:02,220 --> 00:01:03,750 as to whether or not local storage 27 00:01:03,750 --> 00:01:08,340 is truly a secure location to put a JSON web token. 28 00:01:08,340 --> 00:01:10,530 In theory if someone manages to execute 29 00:01:10,530 --> 00:01:13,440 a cross-site scripting attack on your website, 30 00:01:13,440 --> 00:01:16,260 they could possibly pull the token out of local storage, 31 00:01:16,260 --> 00:01:18,690 and then use it to impersonate that user. 32 00:01:18,690 --> 00:01:21,150 This is really an unsolved problem right now 33 00:01:21,150 --> 00:01:23,220 and when you're using JSON web tokens 34 00:01:23,220 --> 00:01:25,860 well local storage is possibly 35 00:01:25,860 --> 00:01:28,920 one of the best possibilities or solutions you get, 36 00:01:28,920 --> 00:01:32,130 but it's not necessarily the end all be all solution. 37 00:01:32,130 --> 00:01:33,990 And standards around storage of local 38 00:01:33,990 --> 00:01:36,543 of JSON web tokens are still developing. 39 00:01:38,850 --> 00:01:41,760 Then inside of our require auth dot js file 40 00:01:41,760 --> 00:01:43,020 and our components directory, 41 00:01:43,020 --> 00:01:46,830 I wanna point out that we very, very successfully reused 42 00:01:46,830 --> 00:01:50,283 our require auth higher order component. 43 00:01:51,150 --> 00:01:52,380 I really encourage you to think 44 00:01:52,380 --> 00:01:54,150 about putting together higher order components 45 00:01:54,150 --> 00:01:56,130 on your own personal projects 46 00:01:56,130 --> 00:01:58,830 and figuring out ways to extend functionality 47 00:01:58,830 --> 00:02:02,370 of your simple components with higher order components 48 00:02:02,370 --> 00:02:05,730 that you can reuse on future projects you put together. 49 00:02:05,730 --> 00:02:09,180 Really this was a great example of how we put one together 50 00:02:09,180 --> 00:02:13,140 on our earlier project and then very easily reused it 51 00:02:13,140 --> 00:02:15,440 on this newer project that we were working on. 52 00:02:16,590 --> 00:02:17,640 And the last thing I wanna talk 53 00:02:17,640 --> 00:02:19,320 about very briefly is what we just did 54 00:02:19,320 --> 00:02:22,590 in the last section where we imported a CSS file 55 00:02:22,590 --> 00:02:24,900 into our header dot js file. 56 00:02:24,900 --> 00:02:26,100 A lot of people don't know this, 57 00:02:26,100 --> 00:02:29,280 but yes create react app is wired to allow you to 58 00:02:29,280 --> 00:02:33,060 import CSS files directly into your JavaScript code. 59 00:02:33,060 --> 00:02:35,730 And create react app ships with some configuration 60 00:02:35,730 --> 00:02:38,973 for Webpack that handles this in an appropriate fashion. 61 00:02:40,080 --> 00:02:42,480 Okay so I think that's about it of some 62 00:02:42,480 --> 00:02:45,630 of the high points on the client side of this project. 63 00:02:45,630 --> 00:02:47,460 So I hope you enjoyed putting this project together 64 00:02:47,460 --> 00:02:51,120 'cuz it certainly was a lot of fun to put together with you 65 00:02:51,120 --> 00:02:52,140 and I hope to see you 66 00:02:52,140 --> 00:02:54,513 on another course at some point in the future.