WEBVTT

00:00.680 --> 00:02.520
Hi everyone!

00:03.440 --> 00:16.000
After we already published the authentication we need to build a route for gets the.

00:16.640 --> 00:18.720
For example, I get users.

00:19.680 --> 00:23.080
Okay, let me show you how we can do that.

00:27.840 --> 00:29.440
Here's our user controller.

00:29.440 --> 00:32.160
We already have a profile, right?

00:32.800 --> 00:38.440
Right now I will use the request decorator.

00:40.720 --> 00:44.200
With the request from Express.js.

00:44.760 --> 00:54.200
In here we can return directly request dot user right here okay.

00:58.440 --> 01:12.970
And if we open Does most men and said, right here you can say we already lost the user credential,

01:13.210 --> 01:13.690
right?

01:16.290 --> 01:21.170
And let me show you one more better way to do that.

01:21.610 --> 01:28.770
Let's imagine we will have a current user decorator okay.

01:29.050 --> 01:33.090
First of all like that with the current user right here.

01:33.690 --> 01:36.970
And we will boost the current user directly over here.

01:40.050 --> 01:42.970
This will be much more better right.

01:43.730 --> 01:50.290
So in order to do that let's create the custom decorator.

01:56.250 --> 02:06.510
And inside here let's look at the custom decorator from the Next.js Official documentation.

02:08.670 --> 02:10.550
And we will copy everything.

02:10.750 --> 02:11.230
Okay.

02:11.790 --> 02:14.870
Don't try to remember us.

02:25.190 --> 02:28.790
Let me rename to current user okay.

02:29.710 --> 02:31.390
And request dot.

02:33.110 --> 02:38.190
Uh right here we need to use Express.js.

02:41.830 --> 02:45.790
Dot current users inside user controller.

02:46.310 --> 02:50.750
We will import us with the user right here.

02:51.550 --> 02:56.670
We can, uh, create I user by lot.

02:59.030 --> 03:01.510
And got the current users.

03:06.070 --> 03:07.400
Now let me.

03:10.120 --> 03:14.960
Say it also works very good.

03:15.440 --> 03:18.080
And I want views there.

03:21.200 --> 03:23.320
Now in the set of the video for.

03:23.320 --> 03:24.040
That's right.

03:24.680 --> 03:27.920
So let me show you inside the video right here.

03:27.920 --> 03:30.600
I will go to a new file on this one.

03:30.920 --> 03:33.320
Use this.

03:34.640 --> 03:36.040
Create a file.

03:41.120 --> 03:44.200
First of all use a little.

03:46.440 --> 03:47.040
Mouse.

03:48.640 --> 03:49.160
And.

03:56.840 --> 03:57.480
Oh sorry.

03:57.960 --> 03:59.600
We need to create a class.

04:00.120 --> 04:00.760
My bad.

04:23.540 --> 04:25.420
Go back to the user controller.

04:27.740 --> 04:28.420
Right here.

04:28.700 --> 04:32.940
We will use the transform radio.

04:38.660 --> 04:42.180
And move the ball user over here.

04:46.140 --> 04:46.940
Now let's say.

04:50.980 --> 04:51.500
Okay.

04:51.540 --> 04:52.820
This already worked.

04:53.500 --> 04:55.300
We already customized as.

04:58.580 --> 05:00.860
Very best way.

05:00.860 --> 05:03.460
It will go to the case right here.

05:04.580 --> 05:05.060
Okay.

05:05.460 --> 05:09.100
So that is just for the video.

05:09.980 --> 05:12.100
And I will see you in the next one.
