Hi everyone!
After we already published the authentication we need to build a route for gets the.
For example, I get users.
Okay, let me show you how we can do that.
Here's our user controller.
We already have a profile, right?
Right now I will use the request decorator.
With the request from Express.js.
In here we can return directly request dot user right here okay.
And if we open Does most men and said, right here you can say we already lost the user credential,
right?
And let me show you one more better way to do that.
Let's imagine we will have a current user decorator okay.
First of all like that with the current user right here.
And we will boost the current user directly over here.
This will be much more better right.
So in order to do that let's create the custom decorator.
And inside here let's look at the custom decorator from the Next.js Official documentation.
And we will copy everything.
Okay.
Don't try to remember us.
Let me rename to current user okay.
And request dot.
Uh right here we need to use Express.js.
Dot current users inside user controller.
We will import us with the user right here.
We can, uh, create I user by lot.
And got the current users.
Now let me.
Say it also works very good.
And I want views there.
Now in the set of the video for.
That's right.
So let me show you inside the video right here.
I will go to a new file on this one.
Use this.
Create a file.
First of all use a little.
Mouse.
And.
Oh sorry.
We need to create a class.
My bad.
Go back to the user controller.
Right here.
We will use the transform radio.
And move the ball user over here.
Now let's say.
Okay.
This already worked.
We already customized as.
Very best way.
It will go to the case right here.
Okay.
So that is just for the video.
And I will see you in the next one.