1
00:00:00,200 --> 00:00:03,740
Okay, so now we're ready to work on our back end authentication.

2
00:00:03,740 --> 00:00:10,940
And just like we have a product route and a product controller, we're going to have a user route and

3
00:00:10,940 --> 00:00:12,200
a user controller.

4
00:00:12,200 --> 00:00:18,140
And I think what I would like to do instead of just creating them as we go in this video, I just want

5
00:00:18,140 --> 00:00:24,020
to create all of the routes and controller methods and for now we'll just have them respond with just

6
00:00:24,020 --> 00:00:25,430
a string or something.

7
00:00:25,430 --> 00:00:31,910
But as we go, we'll add our functionality to them, if that makes sense.

8
00:00:31,910 --> 00:00:38,030
So I just want to basically have a skeleton, just a structure of our routes and controllers first.

9
00:00:38,030 --> 00:00:46,190
So let's go ahead and go into routes in our back end and create a new folder called User Routes Dot

10
00:00:46,190 --> 00:00:46,940
JS.

11
00:00:46,940 --> 00:00:51,680
And then we're also going to create a new controller called User.

12
00:00:52,940 --> 00:00:54,260
Controller.

13
00:00:56,850 --> 00:00:58,260
Dot JS.

14
00:00:58,880 --> 00:01:03,260
And I think the best thing to do here would be to just start out with.

15
00:01:05,129 --> 00:01:08,550
Let's let's start off with the controller functions.

16
00:01:08,580 --> 00:01:13,890
Now, just like with the product controller, we're going to use the async handler because we're using

17
00:01:13,890 --> 00:01:16,950
mongoose methods inside of here.

18
00:01:17,460 --> 00:01:21,670
And then we're also going to need the user model, which we already created.

19
00:01:21,690 --> 00:01:28,140
So if we look in models, we should already have your user schema and be exporting your model from here.

20
00:01:28,320 --> 00:01:32,010
So let's I'm just going to copy from the product controller.

21
00:01:32,040 --> 00:01:36,270
These two imports, I'll grab one of these routes as well.

22
00:01:37,500 --> 00:01:44,010
And then in the user controller, we'll paste that in and we're just going to change this to user and

23
00:01:44,010 --> 00:01:46,560
we're going to bring in the user model.

24
00:01:48,780 --> 00:01:55,140
And then let's see for the first route here, I want it to be the authentication or the login.

25
00:01:55,140 --> 00:02:02,910
So for the description, let's change that to we'll say auth user and ultimately it's going to get the

26
00:02:02,910 --> 00:02:03,780
token.

27
00:02:04,600 --> 00:02:11,980
And the route is going to be slash API, slash users slash login.

28
00:02:11,980 --> 00:02:17,620
And that's going to be public, obviously, because you're in the process of authenticating.

29
00:02:17,740 --> 00:02:22,750
And then let's call the function name, we'll say auth user.

30
00:02:23,400 --> 00:02:25,920
And we're using the async handler.

31
00:02:25,920 --> 00:02:32,260
And for now, all I want to do get rid of these lines here.

32
00:02:32,280 --> 00:02:33,890
All I want to do is respond.

33
00:02:33,900 --> 00:02:36,540
We'll say rez dot send.

34
00:02:37,370 --> 00:02:41,060
And let's respond with just a string that says auth user.

35
00:02:41,060 --> 00:02:46,220
So just whatever this whatever the function does and then we're going to do the do this for the rest

36
00:02:46,220 --> 00:02:48,590
of the functions in this file.

37
00:02:48,590 --> 00:02:50,570
So let's copy this.

38
00:02:51,910 --> 00:02:54,310
And the next one I want is the registration.

39
00:02:54,310 --> 00:03:02,890
So for the description we'll say register user and it's going to be a I'm sorry, this one right here.

40
00:03:02,890 --> 00:03:05,770
This needs to be a post request because we're submitting.

41
00:03:06,670 --> 00:03:07,450
Same thing here.

42
00:03:07,450 --> 00:03:13,810
So this will be a post request and it'll be to just slash API users because we're creating a new user,

43
00:03:13,810 --> 00:03:14,050
right?

44
00:03:14,050 --> 00:03:19,240
We're creating a new resource and then the name of the function, let's call it register.

45
00:03:20,390 --> 00:03:26,420
Register user and we'll just have a string of register user for now.

46
00:03:27,280 --> 00:03:27,640
Okay.

47
00:03:27,670 --> 00:03:29,740
Next one is going to be log out.

48
00:03:32,470 --> 00:03:33,550
So let's see.

49
00:03:33,550 --> 00:03:38,530
This is we're going to say this is going to log out the user and.

50
00:03:39,110 --> 00:03:44,540
It's also going to clear the cookie because we're going to be storing the Json web token in an Http

51
00:03:44,540 --> 00:03:46,340
only cookie on the server.

52
00:03:46,340 --> 00:03:48,050
So we need to destroy that.

53
00:03:48,050 --> 00:03:51,700
It's not just a matter of clearing local storage in the front end.

54
00:03:51,710 --> 00:03:57,710
So this as far as the route, this will be a post request to API users and then log out.

55
00:03:57,890 --> 00:04:05,060
And this is going to be private because the user is going to obviously be logged in if they want to

56
00:04:05,060 --> 00:04:05,900
log out.

57
00:04:07,170 --> 00:04:09,930
And then let's call this log out.

58
00:04:10,570 --> 00:04:11,620
User.

59
00:04:12,900 --> 00:04:15,180
And just change that to log out.

60
00:04:16,140 --> 00:04:16,410
Okay.

61
00:04:16,440 --> 00:04:19,440
Next one is going to be to get the users profile.

62
00:04:19,440 --> 00:04:20,550
So.

63
00:04:21,660 --> 00:04:28,290
Let's say, get user profile and it's going to be a get request this time.

64
00:04:28,290 --> 00:04:34,830
So let's change this to get and it'll be API slash user slash profile.

65
00:04:35,530 --> 00:04:40,840
And as far as the function name, we're going to call it get user profile.

66
00:04:42,780 --> 00:04:44,640
And for this we'll just say.

67
00:04:47,150 --> 00:04:50,150
User profile or get.

68
00:04:51,160 --> 00:04:52,800
Get user profile.

69
00:04:52,810 --> 00:04:56,680
Now, we're also going to have a route to update the user profile.

70
00:04:56,680 --> 00:04:58,810
So actually I'll just copy this one.

71
00:05:00,130 --> 00:05:03,940
And let's just say update user profile.

72
00:05:03,940 --> 00:05:07,600
And of course this will be a pull request because we're updating data.

73
00:05:07,600 --> 00:05:15,490
So it will be a pull request to API user's profile and it will be private and so will this one.

74
00:05:16,870 --> 00:05:18,610
So that'll be private.

75
00:05:19,240 --> 00:05:26,950
And let's change the name of the function here to update users user profile and change this.

76
00:05:28,440 --> 00:05:29,340
Okay.

77
00:05:29,550 --> 00:05:33,090
And then we're going to have one to get all users.

78
00:05:33,090 --> 00:05:38,280
And this is going to actually be an admin route because we don't want regular users to be able to get

79
00:05:38,280 --> 00:05:39,960
other users information.

80
00:05:39,960 --> 00:05:43,050
That's an admin and admin action.

81
00:05:43,050 --> 00:05:53,640
So what we'll do is here, we'll say private slash admin and it's going to be a get request to API users.

82
00:05:54,950 --> 00:05:57,170
And this is going to we'll just say get.

83
00:05:57,760 --> 00:05:58,960
Users.

84
00:05:59,650 --> 00:06:03,010
And the name of the function is going to be get users.

85
00:06:04,220 --> 00:06:05,510
We'll change this.

86
00:06:06,520 --> 00:06:07,720
Okay, so that's that.

87
00:06:07,720 --> 00:06:09,760
Now we also want to be able to delete users.

88
00:06:09,760 --> 00:06:12,190
That's also going to be an admin action.

89
00:06:13,510 --> 00:06:18,460
So let's say delete users and it will be a delete request.

90
00:06:20,560 --> 00:06:25,300
And when we delete a user, of course we're going to need the ID, so we're going to say colon ID.

91
00:06:26,650 --> 00:06:29,260
And by the way, the update profile.

92
00:06:29,590 --> 00:06:36,460
Notice that here we're not passing in an ID because we're going to use the token because obviously this

93
00:06:36,460 --> 00:06:39,460
this is for the user to update their own profile.

94
00:06:39,460 --> 00:06:46,570
So they only have access to their own user data and that's going to be encoded in the Json web token.

95
00:06:46,570 --> 00:06:49,150
So no need to pass an ID into here.

96
00:06:50,270 --> 00:06:51,440
So let's see.

97
00:06:51,440 --> 00:06:52,430
Delete users.

98
00:06:52,430 --> 00:06:53,780
Let's call this.

99
00:06:55,450 --> 00:06:58,600
I delete do delete user.

100
00:07:00,950 --> 00:07:01,490
Okay.

101
00:07:01,490 --> 00:07:05,990
And then let's just here, we'll just say delete user.

102
00:07:07,510 --> 00:07:07,900
All right.

103
00:07:07,930 --> 00:07:11,920
Now, we also want to be able to get the user by the ID.

104
00:07:13,260 --> 00:07:16,200
Uh, we should probably put that right under this one.

105
00:07:16,890 --> 00:07:18,750
Because that one's to get all users.

106
00:07:18,750 --> 00:07:24,060
But this one will say get user by ID and the request.

107
00:07:24,690 --> 00:07:30,390
Let's see, it's going to be a get request and then API users and then colon ID, it's going to be an

108
00:07:30,390 --> 00:07:38,220
admin function and then get user by ID for the name and we'll just say get user by ID.

109
00:07:39,760 --> 00:07:40,030
All right.

110
00:07:40,030 --> 00:07:42,540
And then the last one is going to be update user.

111
00:07:42,550 --> 00:07:46,480
And this is where the the admin updates the end user.

112
00:07:48,030 --> 00:07:50,310
So that's going to be a put request.

113
00:07:51,290 --> 00:07:55,490
And that's going to be to API users and then colon ID.

114
00:07:57,400 --> 00:08:02,590
And let's change this to update user.

115
00:08:02,770 --> 00:08:04,210
Change this.

116
00:08:05,250 --> 00:08:05,550
Okay.

117
00:08:05,550 --> 00:08:07,290
And I think that should do it now.

118
00:08:07,290 --> 00:08:10,260
We do have to export all these.

119
00:08:10,260 --> 00:08:11,820
So let's say export.

120
00:08:12,910 --> 00:08:17,560
And we're going to pass in here let's say auth user we want.

121
00:08:18,320 --> 00:08:19,910
Register user.

122
00:08:20,700 --> 00:08:22,230
Log out user.

123
00:08:24,120 --> 00:08:27,510
Get pro or get user profile.

124
00:08:29,480 --> 00:08:31,370
Update User profile.

125
00:08:31,970 --> 00:08:38,030
We want get users and delete user.

126
00:08:39,470 --> 00:08:40,049
What else?

127
00:08:40,070 --> 00:08:41,510
Get user by ID.

128
00:08:42,480 --> 00:08:44,159
And update user.

129
00:08:44,159 --> 00:08:46,020
I think that should do it.

130
00:08:46,890 --> 00:08:51,930
Okay, Now what we want to do since we have all these functions is we want to go into our routes.

131
00:08:51,930 --> 00:09:00,690
So we want to go into user routes and basically just connect those controller functions to, excuse

132
00:09:00,690 --> 00:09:05,310
me, to our user routes, just like we did here in the product router.

133
00:09:05,320 --> 00:09:07,440
In fact, I'm just going to copy this.

134
00:09:08,340 --> 00:09:13,380
And because we do want to bring in Express, we want to bring in the router now, we want to bring in

135
00:09:13,380 --> 00:09:18,240
our functions from the user controller and get rid of that.

136
00:09:18,240 --> 00:09:21,350
And we want to just bring in all the ones we exported.

137
00:09:21,360 --> 00:09:26,910
In fact, what I'll do is go to the user controller and just copy all of these.

138
00:09:27,550 --> 00:09:30,790
And then we can just paste those in here like that.

139
00:09:32,910 --> 00:09:33,690
Okay.

140
00:09:33,690 --> 00:09:35,460
And let's see.

141
00:09:35,700 --> 00:09:37,530
Actually, I'm going to put the router.

142
00:09:39,530 --> 00:09:40,520
Now, that's fine.

143
00:09:41,360 --> 00:09:44,180
Now down here where we create our roots.

144
00:09:44,840 --> 00:09:52,390
So we'll keep this so router dot route and slash, which is going to be just slash API slash users.

145
00:09:52,400 --> 00:09:59,870
If it's a get request, then we're going to do get users and ultimately that's going to be an admin

146
00:09:59,870 --> 00:10:02,090
function, an admin route.

147
00:10:02,120 --> 00:10:09,320
So we're going to have to add middleware to make it so only admins can get users if it's a post request.

148
00:10:09,320 --> 00:10:12,140
So let's do dot post.

149
00:10:13,260 --> 00:10:17,550
If it's a post request, then that's going to register a user.

150
00:10:18,900 --> 00:10:23,100
Now for let's see, let's do the log out.

151
00:10:24,740 --> 00:10:26,900
Um, yeah, we'll do the log out next.

152
00:10:26,900 --> 00:10:29,510
So let's say router dot.

153
00:10:30,730 --> 00:10:38,500
And here, since we only have one method to log like we only have a post request to log out, we're

154
00:10:38,500 --> 00:10:40,300
not doing a get or put or whatever.

155
00:10:40,300 --> 00:10:47,980
So instead of doing router dot route, let's say router dot post to slash log out.

156
00:10:48,960 --> 00:10:55,380
And we don't need let's see, we don't need to have this so we can get rid of that.

157
00:10:55,380 --> 00:11:00,210
Since we're doing router dot post, we just put in the root and then a comma and then whatever function

158
00:11:00,210 --> 00:11:04,080
we want to fire off, which is going to be log out user.

159
00:11:04,170 --> 00:11:11,940
And then for log in, we're going to have a post request to log in and that's going to call log in user.

160
00:11:13,870 --> 00:11:14,830
Wait, is it locked?

161
00:11:14,860 --> 00:11:16,210
No, it's auth user.

162
00:11:18,860 --> 00:11:21,110
If you want to call it Loginuser, that's fine.

163
00:11:21,110 --> 00:11:23,180
Just make sure you change it in the controller.

164
00:11:23,330 --> 00:11:30,620
And then let's see for the profile route we do have we do have a get and a put, so I'm going to do

165
00:11:30,620 --> 00:11:32,630
router dot route for that.

166
00:11:33,970 --> 00:11:38,770
And let's say router dot route on.

167
00:11:39,790 --> 00:11:42,250
So we're doing the profile.

168
00:11:42,250 --> 00:11:50,350
So yeah, we'll do slash profile and if we do a get request to that, then it's going to call the get

169
00:11:50,380 --> 00:11:53,650
user profile, right?

170
00:11:53,650 --> 00:11:58,990
And then if it's a put request, then it will be the update user profile.

171
00:12:01,220 --> 00:12:09,710
Now to delete the user, to get the user by the ID or to update the user, We have to we're going to

172
00:12:09,710 --> 00:12:10,850
have this in the root.

173
00:12:10,880 --> 00:12:14,810
The colon ID So for this, let's say router dot root.

174
00:12:16,330 --> 00:12:21,130
And let's say if it's slash colon ID.

175
00:12:22,690 --> 00:12:22,990
Right.

176
00:12:22,990 --> 00:12:28,510
And remember this, all of these are connected to slash API slash users, right?

177
00:12:28,510 --> 00:12:33,040
So this is actually going to be slash API slash users.

178
00:12:33,070 --> 00:12:37,270
This will be slash API slash user slash logout and so on.

179
00:12:37,510 --> 00:12:41,710
So for the ID, let's do if it's a delete request.

180
00:12:42,620 --> 00:12:45,320
Then we're going to call delete user.

181
00:12:45,620 --> 00:12:51,020
If it's a get request, then we're going to call get user by D.

182
00:12:51,140 --> 00:12:56,480
And if it's a put request, then we're going to call update User.

183
00:12:57,700 --> 00:13:02,390
Okay, so those are all of our user routes and then just make sure you export the router.

184
00:13:02,410 --> 00:13:10,210
So now what we can do is go into our server.js in the back end and let's bring in the user routes just

185
00:13:10,210 --> 00:13:12,100
like we did product routes.

186
00:13:12,750 --> 00:13:16,590
So change that to user and then change this.

187
00:13:17,300 --> 00:13:21,890
Two user routes and then we'll just add that down here.

188
00:13:21,920 --> 00:13:23,300
Copy this down.

189
00:13:24,430 --> 00:13:30,460
So this will be user and this is going to be API slash users.

190
00:13:32,000 --> 00:13:32,660
All right.

191
00:13:32,660 --> 00:13:39,410
So now, since we did all that, we should be able to go to Postman and test some of these out.

192
00:13:39,620 --> 00:13:41,630
In fact, we can add some.

193
00:13:42,560 --> 00:13:45,620
Let's add a new folder here.

194
00:13:46,520 --> 00:13:53,600
So this is in collections and I'm going to just add a new collection and let's call this users.

195
00:13:54,800 --> 00:13:58,620
Okay, so any requests that have to do with users will go here.

196
00:13:58,640 --> 00:14:00,920
So let's say add request.

197
00:14:01,530 --> 00:14:04,350
And let's start with the authentication.

198
00:14:04,350 --> 00:14:09,240
So we'll say auth user or login user, however you want to say it.

199
00:14:09,240 --> 00:14:15,980
And what this is going to be is a post request to excuse me to base URL.

200
00:14:15,990 --> 00:14:17,850
So we want to do our base.

201
00:14:19,090 --> 00:14:21,970
Base URL slash API.

202
00:14:22,390 --> 00:14:26,560
Well, actually API is included in the in that base URL.

203
00:14:26,560 --> 00:14:28,900
So we just have to do slash users.

204
00:14:30,040 --> 00:14:39,580
And if it's a post request to that and we send, we get okay we get registered user if it's a post login

205
00:14:39,580 --> 00:14:41,530
is actually slash login.

206
00:14:43,510 --> 00:14:44,410
Or auth.

207
00:14:45,370 --> 00:14:45,730
All right.

208
00:14:45,730 --> 00:14:47,080
And we can save this.

209
00:14:47,080 --> 00:14:48,820
So I'll click save.

210
00:14:50,170 --> 00:14:54,160
And now under our users collection we have our auth user row.

211
00:14:54,190 --> 00:15:00,070
Now, when we're ready to actually use this, we're obviously we're going to send some data in the body

212
00:15:00,070 --> 00:15:03,790
because we need a user, an email and password to log in.

213
00:15:03,790 --> 00:15:07,150
But I just right now we're just testing the routes.

214
00:15:07,150 --> 00:15:09,430
So let's create another request.

215
00:15:10,240 --> 00:15:13,930
So we'll say add request and this one will be for register.

216
00:15:14,650 --> 00:15:17,950
User which will be a post request to.

217
00:15:19,510 --> 00:15:22,720
Base URL slash users.

218
00:15:23,810 --> 00:15:25,910
Just slash users, nothing else.

219
00:15:25,910 --> 00:15:28,040
And that should be our register.

220
00:15:28,040 --> 00:15:29,630
So we'll go ahead and save that.

221
00:15:31,120 --> 00:15:31,600
Okay.

222
00:15:31,600 --> 00:15:33,400
If we do, let's see.

223
00:15:33,980 --> 00:15:35,230
Ad request.

224
00:15:35,260 --> 00:15:36,640
Let's do, um.

225
00:15:37,720 --> 00:15:39,160
Let's do the log out.

226
00:15:39,160 --> 00:15:42,790
So that will be, let's say log out user.

227
00:15:44,070 --> 00:15:46,560
That will be a post request to.

228
00:15:47,560 --> 00:15:50,890
Base URL slash user slash logout.

229
00:15:52,150 --> 00:15:55,630
Send that log out user will save.

230
00:15:57,900 --> 00:16:00,000
And let's add another request.

231
00:16:00,000 --> 00:16:01,380
This one is going to be.

232
00:16:02,370 --> 00:16:03,690
What else do we have here?

233
00:16:03,690 --> 00:16:05,310
We can do the get profile.

234
00:16:05,310 --> 00:16:08,850
So we'll say get user profile.

235
00:16:10,230 --> 00:16:18,540
That's going to be a get request to base URL slash user slash and then profile.

236
00:16:20,210 --> 00:16:20,480
Okay.

237
00:16:20,480 --> 00:16:25,820
And as long as you're seeing a 200 response with the text here, then it's working because we didn't

238
00:16:25,820 --> 00:16:28,190
add any other type of functionality.

239
00:16:28,400 --> 00:16:30,290
So that's get user profile.

240
00:16:30,290 --> 00:16:32,570
Now let's do the update user profile.

241
00:16:32,570 --> 00:16:33,620
So add request.

242
00:16:33,620 --> 00:16:37,340
And again, you don't have to do this like save all of these.

243
00:16:37,340 --> 00:16:42,710
I'm just doing it because it's I like it to be organized so that I can just go to a tab and I can just

244
00:16:42,710 --> 00:16:43,430
make the request.

245
00:16:43,430 --> 00:16:49,370
I don't have to keep opening new tabs and closing them and typing in new URLs and stuff like that.

246
00:16:49,370 --> 00:16:51,740
It's just it's just being organized.

247
00:16:52,380 --> 00:16:54,900
So we'll say update user profile.

248
00:16:55,170 --> 00:17:02,070
That's going to be a put request to base URL slash user slash profile.

249
00:17:03,150 --> 00:17:05,400
Send that and we get update.

250
00:17:05,790 --> 00:17:06,750
Save it.

251
00:17:07,589 --> 00:17:08,700
And let's see.

252
00:17:08,700 --> 00:17:12,240
I think that's all of them except the admin stuff.

253
00:17:13,000 --> 00:17:13,390
Yeah.

254
00:17:13,390 --> 00:17:14,829
So now let's do the admin.

255
00:17:14,829 --> 00:17:15,970
And you could.

256
00:17:16,990 --> 00:17:19,240
Could create a new folder.

257
00:17:20,260 --> 00:17:22,180
Called admin just so we can.

258
00:17:22,839 --> 00:17:26,750
You know, distinguish which ones are admin and which ones aren't.

259
00:17:26,770 --> 00:17:31,810
So in admin, let's add a request to get all the users.

260
00:17:31,810 --> 00:17:33,790
So that'll be the base URL.

261
00:17:35,190 --> 00:17:36,840
Slash users.

262
00:17:38,690 --> 00:17:40,400
And it's a get request.

263
00:17:40,400 --> 00:17:41,360
Send it.

264
00:17:41,880 --> 00:17:42,200
Okay.

265
00:17:42,230 --> 00:17:48,590
Now, again, when when we actually have our functionality and we have our authentication set up, we'll

266
00:17:48,590 --> 00:17:54,860
have to send a token in the cookie to actually be able to access this.

267
00:17:54,860 --> 00:18:00,110
But right now it's all open because we haven't added that, that middleware, we haven't added that

268
00:18:00,110 --> 00:18:01,400
authentication yet.

269
00:18:02,190 --> 00:18:03,390
So let's save that.

270
00:18:03,390 --> 00:18:04,380
And then let's see.

271
00:18:04,380 --> 00:18:05,640
We'll add another one.

272
00:18:06,730 --> 00:18:12,490
To let's do the get get the user by D, So I'm just going to name this.

273
00:18:13,710 --> 00:18:16,590
Get user by ID.

274
00:18:17,750 --> 00:18:23,450
And that'll be a get request to base URL.

275
00:18:24,030 --> 00:18:25,400
Slash users.

276
00:18:25,410 --> 00:18:28,500
And then we need the ID, so we're going to put colon ID here.

277
00:18:28,500 --> 00:18:33,630
And then you'd put the value of whatever ID you want to get, whatever user.

278
00:18:33,630 --> 00:18:35,610
So for now.

279
00:18:37,970 --> 00:18:40,820
What I'm going to do is open up my products.

280
00:18:41,460 --> 00:18:43,710
And let's see, we'll get our products.

281
00:18:43,710 --> 00:18:46,380
And there's a user right here that I'm going to grab.

282
00:18:49,610 --> 00:18:49,970
Okay.

283
00:18:49,970 --> 00:18:51,170
And I'm just going to put that in there.

284
00:18:51,170 --> 00:18:55,100
It doesn't matter right now what we put in here, because again, we're just returning a string.

285
00:18:55,100 --> 00:18:59,360
But for later, at least we'll have a user's ID in there.

286
00:19:00,430 --> 00:19:01,840
All right, save that.

287
00:19:02,410 --> 00:19:02,980
Okay.

288
00:19:02,980 --> 00:19:04,180
And then we're almost there.

289
00:19:04,180 --> 00:19:06,340
So the next one is going to be the delete.

290
00:19:06,940 --> 00:19:07,540
Oops.

291
00:19:07,990 --> 00:19:09,970
We're going to do new request.

292
00:19:11,360 --> 00:19:13,880
Say delete user.

293
00:19:15,910 --> 00:19:20,830
It's going to be a delete request to, let's say, base URL.

294
00:19:22,030 --> 00:19:27,100
Slash users slash and then the ID.

295
00:19:27,280 --> 00:19:31,360
So once again, colon ID, and then I'll just paste in an ID here.

296
00:19:32,150 --> 00:19:32,810
Send.

297
00:19:32,810 --> 00:19:33,610
Test it out.

298
00:19:33,620 --> 00:19:34,520
That works.

299
00:19:34,520 --> 00:19:35,480
We'll save it.

300
00:19:35,480 --> 00:19:38,140
And then finally, we want the update user.

301
00:19:38,150 --> 00:19:41,300
So in admin I'm going to add a request.

302
00:19:42,590 --> 00:19:43,970
Update user.

303
00:19:45,100 --> 00:19:46,510
Port request.

304
00:19:47,870 --> 00:19:51,860
Base URL slash user slash and then ID.

305
00:19:53,360 --> 00:19:56,420
Paste that in send update user.

306
00:19:56,450 --> 00:19:56,720
All right.

307
00:19:56,720 --> 00:20:01,250
So we know that all of our routes are working up to this point, even though we're just returning a

308
00:20:01,250 --> 00:20:01,640
string.

309
00:20:01,640 --> 00:20:02,990
At least we have them set up.

310
00:20:02,990 --> 00:20:05,180
We have our controller function set up.

311
00:20:05,180 --> 00:20:10,280
So now we're ready in the next video to start working on each route.

312
00:20:10,280 --> 00:20:14,150
And I want to start off with the, the auth user.

313
00:20:14,150 --> 00:20:18,500
So if we go to the controller, this first one right here, I want to start on the login.

