1
00:00:00,330 --> 00:00:00,840
Okay.

2
00:00:00,990 --> 00:00:03,530
And up next, let's set up the test user.

3
00:00:03,540 --> 00:00:11,250
And as a result, the regular user who comes to the application doesn't need to log in or register effectively.

4
00:00:11,250 --> 00:00:12,600
They can just test it out.

5
00:00:13,200 --> 00:00:16,110
And we're going to start by logging out.

6
00:00:17,160 --> 00:00:17,910
And then.

7
00:00:18,770 --> 00:00:20,540
The name here is up to you.

8
00:00:20,600 --> 00:00:22,280
Same goes for email and password.

9
00:00:22,280 --> 00:00:26,900
Just keep in mind that of course it's going to be visible.

10
00:00:26,900 --> 00:00:33,050
Meaning if let's say somebody wants to go and check out the password in DevTools, they will be able

11
00:00:33,050 --> 00:00:33,510
to do it.

12
00:00:33,530 --> 00:00:34,310
Don't worry.

13
00:00:34,520 --> 00:00:42,020
Of course we will restrict certain actions for that test user, but let's say a password, it doesn't

14
00:00:42,020 --> 00:00:48,560
really make sense to come up with anything really complex since it's going to be visible in DevTools.

15
00:00:48,680 --> 00:00:50,480
So let's start here with name.

16
00:00:50,480 --> 00:00:53,870
I'm going to go with test user again.

17
00:00:53,870 --> 00:00:56,680
You'll be able to change those values later technically.

18
00:00:56,690 --> 00:01:01,090
So don't worry if you don't have right away the same as me yet.

19
00:01:01,110 --> 00:01:05,690
I'm going to go test user at test dot com.

20
00:01:05,690 --> 00:01:09,770
And then as far as the password, again, in my case, I'm going to go with secret because it doesn't

21
00:01:09,770 --> 00:01:11,150
really make a difference.

22
00:01:11,820 --> 00:01:13,500
So I create that user.

23
00:01:13,770 --> 00:01:15,120
Let me go and check it out.

24
00:01:16,140 --> 00:01:19,530
Let me refresh and we want to get the ID.

25
00:01:20,400 --> 00:01:27,080
Because for a test user, since bunch of things that are going to be restricted, but we still want

26
00:01:28,020 --> 00:01:34,770
a regular person who comes to application, see the features, well, we might as well add some jobs.

27
00:01:34,770 --> 00:01:35,400
Correct?

28
00:01:35,460 --> 00:01:39,450
So at least they can search for stuff and all kinds of things.

29
00:01:39,600 --> 00:01:45,510
So we want to grab that idea and we want to run again that populate remember the one that I showed you

30
00:01:46,110 --> 00:01:47,540
with that macro data?

31
00:01:47,550 --> 00:01:53,270
So we'll do this again one more time and this one is going to be for that test user.

32
00:01:53,280 --> 00:02:00,840
So we want to go back to the project and in here, remember the mock data.

33
00:02:01,350 --> 00:02:04,890
This is where I copy and pasted the previous ID.

34
00:02:04,890 --> 00:02:08,280
So now I'll do that with the test user, so not let me find it.

35
00:02:08,280 --> 00:02:12,950
This is the user over here and let's just take this value.

36
00:02:12,960 --> 00:02:20,430
So we're looking for that ID, We go back to the mock data, select again all the instances of created

37
00:02:20,430 --> 00:02:20,910
by.

38
00:02:22,800 --> 00:02:26,970
And then once we set this one up, we'll copy and paste.

39
00:02:26,970 --> 00:02:30,150
So that's my test user and I'll stop.

40
00:02:30,980 --> 00:02:32,030
My project.

41
00:02:32,670 --> 00:02:38,130
Clear and then we'll go with Node and then populate if you need a refresher.

42
00:02:38,700 --> 00:02:40,540
And this is the logic over here.

43
00:02:40,720 --> 00:02:43,810
And I say, No, we can delete this job.

44
00:02:43,810 --> 00:02:44,110
Delete.

45
00:02:44,110 --> 00:02:50,020
Many technically don't need it, so maybe we don't want to remove the previous jobs.

46
00:02:50,110 --> 00:02:53,200
We just want to add a new one.

47
00:02:54,280 --> 00:02:56,740
Basically all those jobs for that test user.

48
00:02:56,830 --> 00:03:00,100
So let's go with node populate, let's invoke it.

49
00:03:00,460 --> 00:03:05,540
And now our test user should also have those jobs.

50
00:03:05,560 --> 00:03:07,870
Those, I believe, 75.

51
00:03:08,140 --> 00:03:10,030
So let me go back over here.

52
00:03:11,470 --> 00:03:13,060
And refresh.

53
00:03:14,350 --> 00:03:20,650
And then lastly, we want to clear everything and we want to set up the login.

54
00:03:21,470 --> 00:03:28,070
So we don't want the user to log in or register if they just want to test the application, we want

55
00:03:28,070 --> 00:03:29,780
to set up a separate button.

56
00:03:30,230 --> 00:03:32,120
So, yes, this is my test user.

57
00:03:32,120 --> 00:03:36,470
I was able to log in and everything and as set out I should see those 75.

58
00:03:36,500 --> 00:03:36,920
Yep.

59
00:03:37,010 --> 00:03:37,360
Notice.

60
00:03:37,400 --> 00:03:40,100
So this is going to be basically my dummy data.

61
00:03:40,250 --> 00:03:44,840
But before we restrict the access for this test user.

62
00:03:45,870 --> 00:03:49,680
I want to set up a button that basically logs in.

63
00:03:49,950 --> 00:03:56,760
Now, the gotcha here is that we simply want to set up a button, and when we invoke this button, we

64
00:03:56,760 --> 00:04:04,080
want to provide those values that email as well as the password that we just set up.

65
00:04:04,230 --> 00:04:06,240
So let's try this one out.

66
00:04:06,270 --> 00:04:09,420
I'm going to go to register in this case.

67
00:04:09,780 --> 00:04:14,130
So let me look for pages and we're looking for register one.

68
00:04:14,850 --> 00:04:16,529
So let me find what my.

69
00:04:16,529 --> 00:04:17,700
Find where it is.

70
00:04:18,209 --> 00:04:19,529
Page is over here, client.

71
00:04:20,440 --> 00:04:21,579
And then register.

72
00:04:22,290 --> 00:04:27,780
So notice that we invoke the set up user.

73
00:04:28,770 --> 00:04:30,000
On submit, correct?

74
00:04:30,980 --> 00:04:37,970
But now what I want to do is to add another button right below the submit one where effectively I'm

75
00:04:37,970 --> 00:04:41,960
just going to straight up invoke the SAP user.

76
00:04:42,200 --> 00:04:43,510
So how is that going to look like?

77
00:04:43,520 --> 00:04:50,930
Well, right after submit, we're going to go with button and then we'll add type button.

78
00:04:50,930 --> 00:04:52,850
So this is not a submit one.

79
00:04:53,240 --> 00:04:57,950
It's going to be type button and then we'll add class name.

80
00:04:58,310 --> 00:05:02,630
BTN, BTN, BLOCK and BTN Hipster.

81
00:05:02,660 --> 00:05:08,480
Just so the colours are a little bit different and then same deal for is loading.

82
00:05:09,210 --> 00:05:10,710
So while we're loading.

83
00:05:11,780 --> 00:05:18,500
We won't be able to press the button and then we want to go on click and now we want to invoke it.

84
00:05:18,500 --> 00:05:26,390
So instead of waiting for on submit, we'll invoke the setup user once we click on that demo user or

85
00:05:26,390 --> 00:05:27,260
whatever button.

86
00:05:28,350 --> 00:05:31,470
So first let me take the setup user.

87
00:05:32,250 --> 00:05:36,860
Let me scroll down and we'll have to hardcoded those values.

88
00:05:36,870 --> 00:05:37,600
Correct.

89
00:05:37,620 --> 00:05:40,260
Because remember, we just set up that demo user.

90
00:05:40,440 --> 00:05:41,850
So let's go over here.

91
00:05:41,880 --> 00:05:43,140
Let's say that.

92
00:05:43,770 --> 00:05:45,090
We have on click.

93
00:05:45,530 --> 00:05:46,400
Once we.

94
00:05:47,210 --> 00:05:50,180
Click on a button we want to invoke set up user.

95
00:05:50,210 --> 00:05:54,500
Now we just need to hardcoded them so it's not going to be current user.

96
00:05:54,500 --> 00:05:56,540
The endpoint is not going to be register.

97
00:05:56,570 --> 00:06:01,280
We'll actually log in since we already created and then alert text.

98
00:06:01,440 --> 00:06:05,450
So the same or actually copy and paste the wrong one.

99
00:06:05,450 --> 00:06:08,120
So no, we'll say log in successful.

100
00:06:09,800 --> 00:06:16,790
So now we're redirecting and then the current user, I'm not grabbing those values from the state.

101
00:06:17,210 --> 00:06:19,040
I'll actually provide a new one.

102
00:06:19,190 --> 00:06:21,500
I'll say, Yep, it's going to be an object.

103
00:06:21,510 --> 00:06:23,300
And as far as the email.

104
00:06:23,330 --> 00:06:27,230
Now make sure that it matches whatever you have in a database.

105
00:06:27,680 --> 00:06:33,560
So in my case, that is best user at Ask.com because again, we're just performing a logging from the

106
00:06:33,560 --> 00:06:33,860
button.

107
00:06:33,860 --> 00:06:35,060
That's all we're doing.

108
00:06:36,020 --> 00:06:37,520
There's really no magic in there.

109
00:06:37,520 --> 00:06:40,190
So test user ETFs dot com, that's my email.

110
00:06:40,550 --> 00:06:43,460
So that's one I need to provide test user.

111
00:06:44,390 --> 00:06:48,890
By the way, capital case at Test dotcom.

112
00:06:48,890 --> 00:06:54,590
And then as far as the password, look, I said we need to basically provide the password we just set

113
00:06:54,590 --> 00:06:54,740
up.

114
00:06:54,740 --> 00:06:56,940
So in my case, I believe it was secret.

115
00:06:56,960 --> 00:06:58,100
Hopefully I'm correct.

116
00:06:58,370 --> 00:06:59,750
So let me save it.

117
00:06:59,990 --> 00:07:09,050
And in the button, basically, again, we want to set up that logic where if we're loading, then we'll

118
00:07:09,050 --> 00:07:10,250
just display loading.

119
00:07:10,250 --> 00:07:12,320
And then if we're not, then we'll say demo app.

120
00:07:12,620 --> 00:07:15,210
So let's say here is loading on.

121
00:07:15,260 --> 00:07:20,240
If it's true, then we'll go loading, loading, loading that basically.

122
00:07:21,060 --> 00:07:30,000
And as I'm sitting here, the question mark, if we're not loading and we'll say demo app or test user,

123
00:07:30,030 --> 00:07:31,290
that is the real app to you.

124
00:07:31,570 --> 00:07:33,540
So now let me go back to the application.

125
00:07:33,540 --> 00:07:39,450
Notice this is the demo app and I know I already said this 10,000 times, but basically the moment we

126
00:07:39,450 --> 00:07:40,530
click on a button.

127
00:07:41,140 --> 00:07:42,820
We perform a login.

128
00:07:42,850 --> 00:07:43,200
That's it.

129
00:07:43,210 --> 00:07:44,260
That's all we do.

130
00:07:44,890 --> 00:07:48,910
And we log in with those values that were just set up for that test user.

131
00:07:48,920 --> 00:07:55,540
So once you click on this log in, successful blah, blah, blah, and we're good to go, essentially

132
00:07:55,540 --> 00:07:58,990
we can come in and test out the application.

133
00:07:59,170 --> 00:08:01,660
Now, next, like I said, I'll restrict.

134
00:08:02,690 --> 00:08:09,140
The access to the user because I don't want anybody to just come here and start messing with job values

135
00:08:09,140 --> 00:08:09,860
and all that.

136
00:08:09,980 --> 00:08:13,970
I want to kind of keep this as 75 jobs with all of these values.

137
00:08:14,360 --> 00:08:19,520
So if you want to make some changes to this test user, for example, last time in my city, then I

138
00:08:19,520 --> 00:08:20,750
suggest doing that right now.

139
00:08:20,750 --> 00:08:24,110
So for example, in my case, I'm going to say shake and bake.

140
00:08:24,350 --> 00:08:30,610
And then for location, I'm going to say vegan food truck like so.

141
00:08:30,740 --> 00:08:33,440
So save this one still works.

142
00:08:33,440 --> 00:08:39,289
But in the upcoming video, we'll restrict access to this test user.

143
00:08:39,289 --> 00:08:43,039
So the test user is basically read only.

144
00:08:44,010 --> 00:08:50,040
The user can come here, take a look at the application, but he or she cannot add jobs, delete jobs,

145
00:08:50,040 --> 00:08:53,340
modify jobs, or change the profile.

