WEBVTT

00:00.720 --> 00:02.280
Hi everyone.

00:02.280 --> 00:08.840
In previous video we already created data inside database, right?

00:09.320 --> 00:16.040
You can go to the database and find new data.

00:21.200 --> 00:24.360
Right now it doesn't have any data.

00:24.560 --> 00:25.040
Why?

00:26.000 --> 00:26.960
The reason?

00:26.960 --> 00:37.840
Because you can say in order to save data we will need to use the dot save method.

00:37.880 --> 00:38.360
Right?

00:38.920 --> 00:42.000
So for that reason in this guy we bought the save method.

00:43.800 --> 00:44.480
Like this.

00:48.520 --> 00:52.040
Let me say it again okay.

00:52.960 --> 00:55.080
And let's refresh.

01:07.680 --> 01:09.560
With a stabilizer.

01:09.960 --> 01:12.240
But right now you can see the bus work.

01:12.240 --> 01:16.320
Right here is a blind test.

01:16.320 --> 01:17.160
But work.

01:17.280 --> 01:18.600
And it's not good at all.

01:19.200 --> 01:24.560
We need to pass the bus work and save the husband.

01:24.560 --> 01:26.040
Work into the database.

01:26.520 --> 01:35.080
So in order to do that, you can open the security section right here and click on encryption and has

01:35.080 --> 01:35.560
since.

01:38.000 --> 01:39.960
We have some viewing okay.

01:40.000 --> 01:43.200
You can use the crypto module.

01:44.160 --> 01:50.480
But the best way is using the outside library okay.

01:50.640 --> 01:53.840
Firstly we need to install the Pi grip.

02:02.760 --> 02:04.320
Let me install that okay.

02:06.120 --> 02:12.080
After that we need to install the dependency So for TypeScript also.

02:16.080 --> 02:16.880
After us.

02:22.280 --> 02:27.040
We need to say how it can be used in order to use us.

02:27.440 --> 02:37.640
We need to use the Pycrypto hash function and both the plaintext password over here and the sound.

02:38.080 --> 02:38.600
Okay.

02:39.520 --> 02:41.600
Let's say right here.

02:43.440 --> 02:45.320
We need to move fast.

02:45.360 --> 02:45.800
Okay.

02:50.520 --> 02:55.440
Outside here I will create a constant value based sales will be ten.

02:56.400 --> 02:56.880
Okay.

02:57.720 --> 03:00.840
And inside here we need to ask what.

03:04.000 --> 03:08.600
Click y and we need to import the pie graph.

03:08.880 --> 03:09.440
Okay.

03:09.560 --> 03:13.680
Let's copy this line import by grip.

03:13.680 --> 03:13.790
It.

03:17.310 --> 03:18.950
Now has.

03:20.710 --> 03:22.550
We will boost the blind test.

03:22.550 --> 03:26.550
But what will be from the side of little does not work right.

03:27.070 --> 03:34.550
And we would sell over here and soon we use a y muscle.

03:34.550 --> 03:36.670
We use the async function.

03:39.070 --> 03:41.750
And inside here is the user model.

03:42.550 --> 03:43.070
We need.

03:43.070 --> 03:45.030
What will be the email.

03:46.550 --> 03:48.070
Actually right here you can.

03:48.110 --> 03:49.390
This chart will be lost.

04:05.190 --> 04:11.070
And with the password we will replace it with the hash password over here.

04:13.670 --> 04:19.070
And right here we can use directly the password over here Okay.

04:22.070 --> 04:22.990
Now let's say.

04:27.350 --> 04:29.790
I will sign up with a new email.

04:30.750 --> 04:37.990
I will say, now you can say it already generates the new password, right?

04:38.830 --> 04:40.230
Very very cool.

04:41.390 --> 04:41.790
And.

04:48.310 --> 04:53.030
One more thing we should do is not return a password.

04:53.390 --> 04:53.950
Right?

04:54.630 --> 04:59.550
Well, in order to do that, we can use the old controller.

04:59.590 --> 05:01.030
Go back to the controller.

05:01.310 --> 05:02.790
Instead of return.

05:03.110 --> 05:05.830
We can use the user right here.

05:06.310 --> 05:11.270
And also we await us because this is a simpler function.

05:18.630 --> 05:20.870
I will return what I want to return.

05:20.870 --> 05:26.470
I want to return this Mrs. Window for similar success.

05:27.070 --> 05:27.630
Okay.

05:27.670 --> 05:30.310
And data wallet will be the user.

05:30.910 --> 05:35.310
And we need to remove the password over here.

05:35.670 --> 05:35.990
Okay.

05:36.030 --> 05:39.150
We have so many option to remove the password.

05:40.710 --> 05:43.990
For example you can replace over here right.

05:45.910 --> 05:51.270
Like name username email.

05:51.310 --> 05:52.670
User email.

05:53.710 --> 05:54.270
Okay.

05:54.510 --> 05:55.950
You can lose like this.

05:57.470 --> 06:05.230
And in the next video I will show you how we can refactor this code in the best way using the interceptor.

06:05.430 --> 06:07.190
But right now, let's keep it simple.

06:14.110 --> 06:15.510
Now it's already worked.

06:15.710 --> 06:20.670
It will return the message and the data, right?

06:23.830 --> 06:26.070
So that's for the video.

06:26.790 --> 06:28.550
And I will see you in the next.
