1
00:00:00,210 --> 00:00:05,220
All right, and once our log-in functionality works on the backend and we have tests that are more the

2
00:00:05,220 --> 00:00:13,170
postman now set up everything on a frontend and micro, thirty seven million times functionality is

3
00:00:13,170 --> 00:00:15,360
going to be almost almost the same.

4
00:00:15,990 --> 00:00:22,500
There's just going to be some differences when it comes to the actual real wiring because this is a

5
00:00:22,500 --> 00:00:23,100
different route.

6
00:00:23,520 --> 00:00:29,760
But if you take a look at the code, it will match pretty much everything that we have already in registry

7
00:00:29,760 --> 00:00:33,480
user and keep in mind that we already did all the heavy lifting.

8
00:00:34,400 --> 00:00:35,720
We set up the state values.

9
00:00:36,020 --> 00:00:37,550
We set up the local storage.

10
00:00:37,850 --> 00:00:40,820
So this should be a smooth sailing.

11
00:00:41,150 --> 00:00:45,740
And as far as the set up, like I said, start with logging user begin blah blah blah.

12
00:00:45,980 --> 00:00:49,220
Set up the imports and not in the context.

13
00:00:49,220 --> 00:00:54,390
I want to create my logging user and it will also be looking for current years.

14
00:00:54,410 --> 00:00:54,800
Why?

15
00:00:55,460 --> 00:00:56,900
Because we will use it in a register.

16
00:00:57,260 --> 00:01:03,050
So in this case, I'm checking if member, if it's a member, logging user, if it's not.

17
00:01:03,320 --> 00:01:05,990
Well, we already ran the register user.

18
00:01:06,200 --> 00:01:06,560
Correct.

19
00:01:06,920 --> 00:01:08,660
So let's start working on that.

20
00:01:09,080 --> 00:01:15,920
And as a quick sign out, I'll try to set up everything on a frontend without having these two screens

21
00:01:16,280 --> 00:01:19,820
because I'm noticing that we write so much code in the error.

22
00:01:20,660 --> 00:01:25,640
And at the very end, I show you everything on a big screen anyway, so we might as well have all of

23
00:01:25,640 --> 00:01:26,510
this real estate.

24
00:01:26,870 --> 00:01:32,510
Now I might change my mind in a few videos, but for now we will do it this way where we'll write the

25
00:01:32,510 --> 00:01:33,020
code.

26
00:01:33,470 --> 00:01:36,020
So there's going to be no small screen over here.

27
00:01:36,200 --> 00:01:42,350
And then once we're done, we're going to navigate to the big screen and I'll go over all the steps.

28
00:01:42,650 --> 00:01:47,240
Now, the first thing that I want to do is actually closed, all my tabs and all that, so I want to

29
00:01:47,240 --> 00:01:48,200
start from scratch.

30
00:01:48,590 --> 00:01:53,270
We're looking for the source and first in context in the actions.

31
00:01:53,660 --> 00:01:55,400
We want to create those actions correct.

32
00:01:55,580 --> 00:01:59,540
So we want to go with logging, user began and blah blah blah.

33
00:01:59,750 --> 00:02:01,940
So here's what I can do.

34
00:02:02,390 --> 00:02:05,450
I can just copy and paste all of them.

35
00:02:06,080 --> 00:02:08,810
So let me set up here copy and paste.

36
00:02:09,320 --> 00:02:13,040
And keep in mind that we're only looking to change.

37
00:02:13,040 --> 00:02:16,010
These writers want to have the register so set up.

38
00:02:16,940 --> 00:02:22,250
My multiple cursors online, this is not going to be a register is going to be logged.

39
00:02:22,490 --> 00:02:26,090
That's pretty much done as far as the actions are concerned.

40
00:02:26,610 --> 00:02:30,860
Online, let's go to reduce her first online.

41
00:02:30,860 --> 00:02:37,040
We're looking for login and then begin success and error, so that still stays the same.

42
00:02:37,670 --> 00:02:43,310
So what's bad here are as well, and I'll copy them just so it can be disappointment.

43
00:02:43,910 --> 00:02:50,180
And then in the app context, right off the register, I'll copy and paste and then let's keep on scrolling.

44
00:02:50,180 --> 00:02:51,470
So we have clear alert.

45
00:02:51,830 --> 00:02:53,870
Click on that, a registered user.

46
00:02:54,110 --> 00:02:57,230
And now let's set up the log in user as well.

47
00:02:57,500 --> 00:03:00,230
So let's go Konst logging user.

48
00:03:00,530 --> 00:03:04,240
Now that is going to be a thing since there's going to be a fresh request.

49
00:03:04,490 --> 00:03:09,920
And let's just say here, current users, so that's the user object that I'm going to be getting.

50
00:03:10,770 --> 00:03:17,130
And then in here, let's go with log, and we're looking for current online user just so we can clearly

51
00:03:17,130 --> 00:03:18,590
see that everything works.

52
00:03:18,810 --> 00:03:23,490
Then let's add that function to our value object.

53
00:03:23,940 --> 00:03:28,800
And then we want to navigate to the pages and more specifically, the register.

54
00:03:29,290 --> 00:03:30,300
We want to import it.

55
00:03:30,720 --> 00:03:38,010
So right after the registered user, we're going to go along and user and user, and let's keep on scrolling,

56
00:03:38,010 --> 00:03:38,820
keep scrolling.

57
00:03:39,120 --> 00:03:44,940
Where we have the Ornge submit, we have the current user at the moment, we're just logging.

58
00:03:45,240 --> 00:03:45,630
Correct.

59
00:03:45,990 --> 00:03:47,920
So what is the next step?

60
00:03:47,940 --> 00:03:53,070
Well, we want to invoke logging user and we want to pass in the current user.

61
00:03:53,460 --> 00:03:54,600
And let's save this.

62
00:03:54,930 --> 00:03:55,530
I don't know.

63
00:03:55,530 --> 00:03:58,170
Let's navigate to the big screen and let's test it out.

64
00:03:58,470 --> 00:04:00,030
So at the moment, I have the dashboard page.

65
00:04:00,420 --> 00:04:00,750
Go ahead.

66
00:04:00,990 --> 00:04:01,440
Awesome.

67
00:04:02,280 --> 00:04:07,980
And I'm actually looking for sir and I'll right away open up everything here, and it looks like I have

68
00:04:07,980 --> 00:04:08,390
a user.

69
00:04:08,400 --> 00:04:09,840
That's why we navigated the way.

70
00:04:10,230 --> 00:04:12,450
It's not what I want to share with me.

71
00:04:12,450 --> 00:04:13,500
Just remove everything.

72
00:04:13,770 --> 00:04:15,630
And let me go back to the register.

73
00:04:16,170 --> 00:04:22,710
And here let's pass in John G-mail dot com and my password.

74
00:04:23,100 --> 00:04:29,760
And then if everything is correct, we should right away see this name, email and password.

75
00:04:30,090 --> 00:04:31,380
And don't worry about this name.

76
00:04:32,100 --> 00:04:32,460
Why?

77
00:04:32,820 --> 00:04:36,000
Well, because remember in our controller, what are we looking for?

78
00:04:36,450 --> 00:04:38,430
We only care about email and password.

79
00:04:38,790 --> 00:04:42,330
Now, if you want, of course, you can remove it from the object and all that.

80
00:04:42,780 --> 00:04:47,310
I just find it a waste of time since again in the controller.

81
00:04:47,670 --> 00:04:48,810
We don't care about the name.

82
00:04:49,260 --> 00:04:53,820
There's going to be no error if it is empty, and therefore I'll just pass it as it is.

83
00:04:54,180 --> 00:05:00,420
And with this in place, we are done with our login functionality set up on the frontend.

