Hi everyone.
In previous video we already created data inside database, right?
You can go to the database and find new data.
Right now it doesn't have any data.
Why?
The reason?
Because you can say in order to save data we will need to use the dot save method.
Right?
So for that reason in this guy we bought the save method.
Like this.
Let me say it again okay.
And let's refresh.
With a stabilizer.
But right now you can see the bus work.
Right here is a blind test.
But work.
And it's not good at all.
We need to pass the bus work and save the husband.
Work into the database.
So in order to do that, you can open the security section right here and click on encryption and has
since.
We have some viewing okay.
You can use the crypto module.
But the best way is using the outside library okay.
Firstly we need to install the Pi grip.
Let me install that okay.
After that we need to install the dependency So for TypeScript also.
After us.
We need to say how it can be used in order to use us.
We need to use the Pycrypto hash function and both the plaintext password over here and the sound.
Okay.
Let's say right here.
We need to move fast.
Okay.
Outside here I will create a constant value based sales will be ten.
Okay.
And inside here we need to ask what.
Click y and we need to import the pie graph.
Okay.
Let's copy this line import by grip.
It.
Now has.
We will boost the blind test.
But what will be from the side of little does not work right.
And we would sell over here and soon we use a y muscle.
We use the async function.
And inside here is the user model.
We need.
What will be the email.
Actually right here you can.
This chart will be lost.
And with the password we will replace it with the hash password over here.
And right here we can use directly the password over here Okay.
Now let's say.
I will sign up with a new email.
I will say, now you can say it already generates the new password, right?
Very very cool.
And.
One more thing we should do is not return a password.
Right?
Well, in order to do that, we can use the old controller.
Go back to the controller.
Instead of return.
We can use the user right here.
And also we await us because this is a simpler function.
I will return what I want to return.
I want to return this Mrs. Window for similar success.
Okay.
And data wallet will be the user.
And we need to remove the password over here.
Okay.
We have so many option to remove the password.
For example you can replace over here right.
Like name username email.
User email.
Okay.
You can lose like this.
And in the next video I will show you how we can refactor this code in the best way using the interceptor.
But right now, let's keep it simple.
Now it's already worked.
It will return the message and the data, right?
So that's for the video.
And I will see you in the next.