1
00:00:00,390 --> 00:00:00,750
All right.

2
00:00:00,780 --> 00:00:08,310
And once we have the Morgan package in place now, let's start working on our log-in functionality and

3
00:00:08,760 --> 00:00:13,500
I mean, most of it is going to be exactly the same as the registered one.

4
00:00:13,830 --> 00:00:15,890
How are there going to be some gotchas?

5
00:00:15,930 --> 00:00:21,000
But if you're comfortable with whatever we did with the register, whether that is the back end or the

6
00:00:21,000 --> 00:00:23,220
front end, you'll be in good shape.

7
00:00:24,180 --> 00:00:31,930
And first, I just want to mention that in our in controller, we will use another error, so check

8
00:00:31,930 --> 00:00:35,520
for email and password, both of them are going to be coming from that body.

9
00:00:36,030 --> 00:00:39,930
And if one of them is missing, we'll send back the 401.

10
00:00:40,350 --> 00:00:45,690
The better question, but also we'll check for user using the email.

11
00:00:46,420 --> 00:00:55,350
Um, if the user does not exist or if the password doesn't match to whatever we have in database, then

12
00:00:55,350 --> 00:01:00,390
I want to send back for a one on authenticated error with invalid credentials.

13
00:01:00,720 --> 00:01:03,090
Now the thing is, we haven't created that error.

14
00:01:03,930 --> 00:01:11,190
So what we do or anything, I want to go to errors and then create the on authenticated yes.

15
00:01:11,490 --> 00:01:14,370
And this probably will be another spelling doozy for me.

16
00:01:15,330 --> 00:01:17,670
And then let's set up import and export.

17
00:01:18,010 --> 00:01:23,700
And in the Congress, and I'm talking about in the Congress in the hours and then as far as the cold.

18
00:01:23,860 --> 00:01:30,210
Well, we'll get the status codes, custom API and then the only thing we want to do is just change

19
00:01:30,210 --> 00:01:34,350
the status quo to unauthorized, which is going to be for one.

20
00:01:34,470 --> 00:01:37,860
And then if you want, you're going to right away import an off controller.

21
00:01:38,220 --> 00:01:39,810
But that's not going to be my case.

22
00:01:40,140 --> 00:01:43,830
So I'll just set up the code and import and export in next year.

23
00:01:44,160 --> 00:01:48,480
So let's go here and I'm going to go with on.

24
00:01:49,500 --> 00:01:52,040
Authenticated, yes.

25
00:01:52,680 --> 00:01:55,920
I'm not speeds up, I'll just grab everything from bad request.

26
00:01:56,960 --> 00:02:01,940
Perished and still looking for status codes, still want the custom empire.

27
00:02:03,050 --> 00:02:10,039
Now, the one thing that I want to change here is the name, and again, we're going to go with an authenticated.

28
00:02:11,030 --> 00:02:20,150
Her and like I said, instead of my request, which is 400, let's go with an authorized, which is

29
00:02:20,150 --> 00:02:20,630
401.

30
00:02:20,930 --> 00:02:24,890
Let's save this and let's set a proper imports here as well.

31
00:02:25,380 --> 00:02:28,370
So I'm going to go with my own authenticated error.

32
00:02:29,060 --> 00:02:33,230
I have proper import with jazz and all of that cool stuff.

33
00:02:33,590 --> 00:02:35,240
And now let me move this sucker down.

34
00:02:35,540 --> 00:02:37,250
And now I'm exporting from errors.

35
00:02:37,550 --> 00:02:38,390
One more error.

36
00:02:38,690 --> 00:02:40,640
The unauthenticated one.

