Hello, friend, welcome back.
In a previous video, we have created one of the function as a user, a function, and also we import
our all that glass function as authenticate function logging and the logout that is our EDP in response
to that and locking the Guard and Reserve.
So now we step by step, we will use all that our diskless function.
So here, first of all, I want to do want to check out these two of these field that username and password
feel is authenticated or not, so we can check it with our diskless function authenticate.
So with this we can actually check it.
So I show you like here I want to do I want to define one of the variable as a user.
And then if this user area I want to define this authenticate, that means with this our class function.
So it this class function.
I want to check out to this field.
So one will be as a user user name is match with our user name.
OK, it means actually this user name, if you go to our database into the database they have also on
the database they will field as the user name.
Right.
And also to have another field as a password.
So I don't want to check it.
So this user is appropriately matched with our these user field or not.
And also same as for our password.
OK, so now I don't want to actually defining it.
So our this user that is our database table feel users match with our logging e-mail input field.
So here I have already defined our input field as a user name, as a password.
Right.
So that the two of the things we have to match so here are define as user name is match or not.
And also I have to define the same things as for the password.
So so we match with our password or not.
So that means if our user name is appropriate, if our password is appropriate, that means this user
is authenticated.
Right.
So now I'm going to want to take on the condition if this user so I take all that our authenticated
user and I just take the things with this variable as a user.
So I just simply defined as a user, OK, that is, if this authenticated user that this user is already
logged in.
And here after that, I want to check this user is active or not.
OK, so if you want to check it, I just put another condition as our if into the if condition with
this user.
That means these authenticated user is is active or not.
So I just simply find another function as active.
So I just simply defined as active.
So with this, I will check our results indicate that the user is active or not.
So if this user is active, then I want to do and define one of the another function.
I want to define another function of the.
OK, that means this logging user then I don't want to pass it to our authenticated user.
That means here our authenticated user.
I take that this one that means our this user is authenticated and also these user is active.
OK, so here I just simply pass that request.
Right.
I hope you can all understand about it.
So when this user is authenticated and when this user is active, they know what to do and to pass on
the piece.
That means this user after this I want to do in the past that we've done so here I define as written
and then here I want to do and to access that SCDP as TDP sorry, SCDP response to that.
So now I want to use this function to why I am using it.
I will show you.
So then it'll be very much clear to who I am actually using that SCDP response to it.
So now I just simply defined as the EDP response to that and then I want to do and define as a reserve.
So that is actually also another function as it is diverse.
So I guess I really find the reverse.
And with this reverse, I want to do the past this user to one of the base.
That means when this user will be approved, appropriate username and password.
After that, it should be elected to our homepage.
OK, so that means you should be redirected to our displays.
So for the homepage, I have already defined all of that.
You all right.
So I have already defined the what else?
Our home page.
What a name.
I have defined that things with the index.
So that is our apt name as a locking up.
So now in particular, that position I define our happening fast as a locking up and then I want to
pass it on our index.
But like a friend, I hope you can well understand about it.
So when this user will be as I indicated.
So I just take that things which is authenticated and also objective user is active or not within this
user is active.
Then I just passed that request to the user.
That means that means this user is totally authenticated that this user is true.
And then when it will be true, I just simply return to the one of the base.
So here with SCDP response and with this redact, I reverse our dis user to our locking index page.
That means it should be redirected to our index based right and elds.
So else what exactly should we do that means when this user is not active.
So that here we have to defining it, say to somebody else, OK, that means if this user is not authenticated,
that means this user pulls out inappropriate user name or the inappropriate password, then what exactly
should be looked at?
So here I want to do want to define then send the message so into the Ayles condition.
I define the return and then SCDP response.
So they have also the city response function with this response function and the source of the message.
So here it shall be shown on the message as an account.
OK, account is not active.
So this type of message is a display and else that means going on.
What total portion is in total person who will be as a fault then what exactly you want to do here?
Also on display on another message so far the results in the LS here are different other URLs and here
I simply define this as TDP response.
Sorry.
So this has to be response.
I want to do on the display some of the message.
So here and this is the message as a login detail like login details are wrong.
So this step up, one of the messages we display and also after that I want to take another Ale's.
I take another is because of like now you can see if you go to our Etoile into the URL I have already
defined on the part as a user logging.
So when this user is how the user is directly accessed, this part, that means here, if you go here,
some of the user, if you go in particular these bacteria, then what exactly to be elected.
Right.
So here also we have to protect each of the regions here.
We have to do we have to define another Ayles.
So into this area that we saw in this user will be allowed to directly access this function.
That means this is well, then I want to do and define as ls it will be written so that another piece
is to be done to our actual logging base.
So I just simply return and then our endor.
So with this sender, I want to pass on the request and then I want to do undeposited, this user when
we access this function that should be accessed.
These are despite this user I want to do and redacted to our this logging.
OK, so that is in our locking up, so here we have to define it, the locking up and then our base
as a locking door.
Right.
I hope you can understand about it enough that I have to do.
I have to defend that contest.
So I just simply defend that context.
And right now, I didn't defend anything for the reasons I just make the things as a blank.
So that's all you have to do.
I hope, friend, you can well understand about it.
So here I have defined our all that feel.
And then I also indicated to of this field if I was to follow through with it, I just put that condition.
So if this user is authenticated and also I define another condition, is the user.
Exactly.
Will not see this user active need to be addicted to our index base.
And this will be displayed as the account is not active and when our total option will be as false,
then should be displayed as a steady response to disaster response.
I display as a logging details are wrong rather than on this user will be direc access our user logging
path.
That means this function.
Then for this one I simply define this user redacted.
It should be the key to our logging as Tamalpais, that's all.
OK, so that's all you have to do.
Now let's check this out.
If you click as I save all, I just click it to save all.
First of all, I want to check it.
Yeah, everything is running well now.
Let's check this out, I just got to refresh so there is a lot going on here, in particular amenorrhea.
I have already created that username as a kasie.
And for the Karzi, I have defined the password as one, two, three, four, five.
Right.
So now I want to actually check it like I just simply defined as it causes.
And then I define the password as a one, two, three, four or five.
And if everything OK should be the key to our homepage right now, click the logging.
Yes, now, considering our user is now successfully locked in for the results, you can see so perfectly
rejected to our index base, so we successfully complete our logging portions.
And now here, one thing I want to share with you, friend, like here I have used that SCDP response
deck with the reserve.
Right.
So why I am actually using it.
So if you don't want to use it, like I show you what exactly it will be happen.
So right now, when it should be rejected now, because it's not perfectly rejected to a specific seawall.
OK, but if you want to change it like here, I changed it.
I just make up things as now as a node.
And here I do find that things with another way sounded like this way.
If you want to directly deck tattoos on the base, you can also reject it.
Like here.
I just simply defined as the written render request right into the request.
If you want to pass that this user that is authenticated user when it will be authenticated, when it
shall be as the active, if you want to pass this user to the specific logging base.
That means our locking up with this locking up now on down ground defined as the index.
Right.
So now it shall be redacted or indexed status HTML.
So I just simply disagree in this draft estimate.
So if you want to parse this like that way and also there is a context I define as a make that into
the blank.
Right.
So if you want to pass with this render request, then what exactly is to be happen?
I show you like if you click the save all, I just get to save all.
Now refresh this space, go to our logging and now onto logging with again as a Kasie and then I different
the password.
One, two, three, four, five knuckler because of logging.
Now considering now we successfully logged in.
But here you can see there is actually our warrell into the URL position now showing our this part.
That means that user logging pop.
So here I have already defined this condition when this you someone will be accessed, that user logging,
it should be redirected to our index page.
Right.
So here I have already finding it.
So that is our condition.
I have defined that is really the cataloging piece.
But here you can see now I'm actually already into this part, but it's not showing our index page,
not that logging base.
But here, if you refresh it after that refresh, you can see it's now redirected to a logging base
and also for the logging base.
I have defined all of the Anatoliy what I have, defining what I should be look like our logging, not
that user logging.
I hope you can well understand about it.
So for preventing this for this, I am actually using this condition.
So that is actually our one of the functions that is a class function as step response to that.
So now I just make as a note and here I want to open it.
So now I think it should be very much clear to you why I'm actually using this, OK.
So with this, you can actually prevent it.
So I just clear the save all and now go to the home now go to the logging.
And now I just simply defend the Karzi.
One, two, three, four, five.
And now if you click on the logging now, you can see that now that is actually appropriate.
You are that I actually want.
So now they have no access for our this portion.
That means this area that we use a logging's for what they use a logging I have already created on the
part.
So now if you use that part, because the enter now concedes no.
Perfectly rejected to you that logging base and also that is a flower logging so perfectly it's not
working.
OK, friends, I hope you can understand about it what exactly the difference between two of these so
you can use it.
So with this our this function that is debate as posted, a function, you can you can prevent this.
You are l a rather than if you pass that things like that where it will be work, but it should be actually
added our another part.
That means our user logging.
But that is the part I have already defined in our you are right.
So right now we will use all of these SCDP responses decks with this is to be response to that function.
We can actually prevent it.
I hope everything is now very much clear to you and we successfully now logged in.
So now we have to also define our log out.
And also here we want to define this step of one of the conditions when this user will be logged in
our this register and the logging, if not, should be visible then only to be visible as a whole.
And the log out and when you click on a log out, then our only that home or register will be visible.
So we can do that step by step.
I will show you the next video I to work for our log out portions.
How can working with that log out in the next video, I will show you that things with the live example.
So thanks for watching.
I will see you in the next video.