1 00:00:00,610 --> 00:00:06,940 Anderson, we are going to create a lot in Asia because at this moment, this just has the worst loss 2 00:00:06,940 --> 00:00:07,270 in. 3 00:00:08,320 --> 00:00:10,870 And actually, we can copy the. 4 00:00:11,900 --> 00:00:17,150 Satchel A and then to a lot in and then we paid. 5 00:00:18,830 --> 00:00:22,730 We have the site apage and we karate's. 6 00:00:25,960 --> 00:00:30,880 At Lockin and of course, this would be lower case. 7 00:00:35,400 --> 00:00:36,000 So now. 8 00:00:37,830 --> 00:00:39,750 We have to go to fix these. 9 00:00:41,920 --> 00:00:49,270 We have to go to fix the law in API, so we back to the server and go to the controller and at this 10 00:00:49,270 --> 00:00:57,220 moment you can see the log in just has this function which send the word login and. 11 00:00:58,370 --> 00:01:07,010 We want to have to use that information, however, we do not have function for Mongoose, but we can 12 00:01:07,010 --> 00:01:08,260 create it by ourselves. 13 00:01:09,410 --> 00:01:14,750 So we go to the user and then type users schema. 14 00:01:17,470 --> 00:01:18,170 Static. 15 00:01:21,450 --> 00:01:21,760 In. 16 00:01:23,990 --> 00:01:26,930 Is equal to the eating functions. 17 00:01:33,370 --> 00:01:35,160 Email, password. 18 00:01:36,260 --> 00:01:38,150 And I what we are going to do it first. 19 00:01:38,180 --> 00:01:42,200 We are going to check whether there is a user access. 20 00:01:42,260 --> 00:01:43,610 So we. 21 00:01:44,610 --> 00:01:49,080 Has to let the constant USA is equal to await. 22 00:01:50,460 --> 00:01:57,920 And then please don't buy one, and then we pass that email, so we search by email, and then if you 23 00:01:58,040 --> 00:02:00,330 use it here, we will do something. 24 00:02:00,660 --> 00:02:07,590 For example, we are going to compare with the password and then if there's no use, there are going 25 00:02:07,590 --> 00:02:15,680 to throw the era incorrect email and then we are going to compare the password. 26 00:02:15,990 --> 00:02:24,750 So we are going to create a Clinton and then you authenticate it is equal to a week and then we use 27 00:02:24,760 --> 00:02:27,460 the microchip to compare the password. 28 00:02:28,210 --> 00:02:34,140 First we are going to compare the password that they use to type in and then we are going to post the 29 00:02:34,140 --> 00:02:42,990 value of the hash, the password, which is goozner password, and then we are going to check if it 30 00:02:42,990 --> 00:02:54,390 is authenticated so it is authenticated, you may return the user, otherwise we will throw the error. 31 00:02:55,500 --> 00:02:57,060 Incorrect password. 32 00:02:57,330 --> 00:02:59,910 Next, we are going to fix the login API. 33 00:02:59,910 --> 00:03:05,550 So we go to the controller and then we can copy it from the site up. 34 00:03:05,760 --> 00:03:13,980 And then we proceed at a lot in page three paces to the log in API and since we do not have to name 35 00:03:13,980 --> 00:03:17,280 so we can delete this one and also this one. 36 00:03:17,970 --> 00:03:24,480 And of course we do not have to create we are going to use login, so we change these to log in. 37 00:03:25,860 --> 00:03:31,540 And this has to the out because we used to wait, so we had to add anything here. 38 00:03:32,880 --> 00:03:41,400 And besides of this, we had to go to activate this alert area functions, because if you remember this 39 00:03:41,430 --> 00:03:47,550 error message, this error message is from the mongoose meditation's. 40 00:03:47,550 --> 00:03:50,540 And now we are going to use these frontera. 41 00:03:50,550 --> 00:03:53,100 So we have to handle it separately. 42 00:03:53,520 --> 00:04:00,690 So we back to the alert area functions and we are going to check if the error message. 43 00:04:00,960 --> 00:04:06,750 Now, we can go to try to prop up the error message and error again. 44 00:04:09,000 --> 00:04:18,860 So if we type where we send and we are going to type a wrong password and we Trixi up now, it has to 45 00:04:18,870 --> 00:04:26,340 era and you look at this, I find is something wrong here, because for the lot in we are not going 46 00:04:26,340 --> 00:04:27,680 to pass the object. 47 00:04:27,750 --> 00:04:30,020 We are going to pass the email and password. 48 00:04:30,480 --> 00:04:35,280 So for the off contract, we have to delete this credit record. 49 00:04:35,430 --> 00:04:42,500 And then we go to the and then we go to the alert error and then we try to sign up. 50 00:04:42,870 --> 00:04:44,280 Actually, this should be locked in. 51 00:04:45,210 --> 00:04:46,620 We can fix these. 52 00:04:47,720 --> 00:04:54,260 And a lot in Page and I, we change this button, as in now we try to lock in. 53 00:04:56,030 --> 00:05:05,390 And see where there is error here and the error message is incorrect, IMO, which is pop up from the 54 00:05:05,390 --> 00:05:06,200 user model. 55 00:05:08,460 --> 00:05:10,620 We can see this error message. 56 00:05:11,160 --> 00:05:20,970 So for the alert error function, we are going to check if error message is equal to this and we are 57 00:05:20,970 --> 00:05:23,730 going to accept the error. 58 00:05:24,120 --> 00:05:27,820 Email is Icko to this email mail. 59 00:05:29,520 --> 00:05:38,130 And then we also duplicate to see if the error message is equal to incorrect password. 60 00:05:38,340 --> 00:05:40,740 Then the error stop password. 61 00:05:42,970 --> 00:05:48,400 Is equal to the password is being correct. 62 00:05:49,030 --> 00:05:53,680 Now we go to try again and not in, you can email Laffont. 63 00:05:54,690 --> 00:05:58,770 And also, if we go to use a real icon. 64 00:06:00,890 --> 00:06:07,490 And with the correct password, all we try to use the incorrect password, you can see the password 65 00:06:07,490 --> 00:06:13,220 used incorrect pop up, and now we typed the correct password and kicked in. 66 00:06:13,460 --> 00:06:18,130 And you will go to the home page and now you can chat with other people. 67 00:06:19,070 --> 00:06:22,190 And the last thing is inside the log in page. 68 00:06:22,220 --> 00:06:28,910 We should not have the name field, so we have to go to back to the kind of site login page and delete 69 00:06:29,240 --> 00:06:30,860 the row about name. 70 00:06:31,430 --> 00:06:34,790 So now we can login with these login page.