Now let's continue with the sign up.
Okay.
Let me go away and I will boost.
Over here will be the side.
So in okay this will be sign.
And I think I will change the name.
We will do the sign.
Let's create a little.
Let me copy the data over here and I will change to.
Sign in video.
And I'm not sure you can.
Sign up video.
I completely forgot that the Visual Studio Code.
It will automatically generate the part for me.
Well, let's go with the sign in.
To sign in, we just need to email and password.
Right.
So right here I will change a little bit.
Sign in detail.
And make sure we change the class name.
To resign video.
And inside of it right here we will create our sign in.
And actually right here we can change the sign up.
To resign.
So we will take a look at the sign in detail.
Oh, sorry.
My bad.
Right here.
So in this your.
Room now.
What we need to do is this guy.
Firstly, we need to find user by email.
Okay.
After we already got the user, we will check for password.
Okay.
We will check the password.
We match or not.
So this only shows that.
And lastly we will generate JSON web token.
Now let me find the user by email.
Finally we will create user figure out why this dot.
What?
Right now.
Uh, we already got user module directly from user service, right?
So this guy let me do something like here Not five one and I will use the email.
We can reach out to us.
If we don't have any user.
We will draw new North Eastern Railway user profile symbol letters and we need to check for the password.
Right.
In order to check for the password.
Let's take a look at the documentation inside the encryption and hashing.
Click on hashing right here in order to compare the password.
We will use the Pycrypto compare and boost the plaintext work.
Okay this is the And this is the hash password.
I will provide it.
Match.
Equal.
Why?
Not compare.
With a password.
And what's a.
Hash symbol?
It will come from the user, right?
User does not work over here.
Okay, guys.
And we need to check.
If we.
Don't match the password, we will return.
Actually right here I will change return a little bit.
We will pass three.
Very sure.
Okay.
And now we need to the rest.
So let's open the sign up.
And I will copy is the car over here?
Moreover here.
And real name is to the user and access token.
And let's recall we will return the user and access token.
But right here we return the same user.
Right.
Hmm.
I think right now we will need to rename it a little bit will be the user and we will fix the interceptor
also.
Right.
Right here we will rename it to the user over here.
And let's test that.
I will remove the name and chain in order.
Sign in.
Now let's test.
I will close.
Now it's already written for me, right?
Uh, data and access token also.
Right.
Let me test.
Uh, invalid email.
It will return the best credential.
Very good.
Say it again.
It's already working.
Let me take the signup again.
It's, uh, work or not?
Okay.
It's already work.
So that is.
That's how we can sign up and sign in.
I hope you understand this video, and I will see you in the next one.