So let's proceed to our next step.
But before we do that we're gonna set back to our default values.
This is gonna be false.
And then also the text is just gonna be an empty string and type is gonna be always always a success.
I'm going to save it.
We're going to open up the sidebar right away.
Maybe you can just remove the rest of the files that I had open and then we're going to look again for
our log in page.
So we have pages.
We have the logging and now of course we have our user context.
Of course we access it already.
But what we're looking for right now is the alert as well as show alert.
So there's gonna be two cases where we want to show alert if dialoguing was successful or there was
some kind of fail.
So we're going to go with user log in then we're looking for alert from our user context and then also
we're looking for the show alert.
So those are the methods that we're looking for or I guess more properly one method and one state value.
So let's look for show alert.
And now once we have access to both of these things we're going to scroll down a bit where we have a
handle submit and we're going to set it up.
First of all if the response was successful so let's say right in between the user log in and there's
three push.
We're going to have our show alert.
And what kind of values would want person.
Well first of all we're going to have some kind of message.
Correct.
So we're going to go with a message.
So SMG parameter or property more correctly then this is going to be equal to a time String.
Say you are logged in.
That's step number one.
Then we're going to access our variable our user name just because I would want to show that so user
name and remember we structured it few videos ago as well as we have some more text of shop or shop
away to chop away my right Mike.
So we're gonna save that.
And also would want to show if there was some kind of error.
So we have the else correct.
If the response is going to be undefined then we're gonna have a different alert.
And in this case we're going to run show alert and we're going to pass in our object a message some
kind of text.
There was an error and then that leaves try again dot dot dot.
And then as far as the type remember by default we're going to have it as a success.
So we're gonna type type.
He is going to be equal to a danger I'm going to say if it is then we're gonna head over to a bigger
browser window just because it's gonna be easier to see going can remember I have my John username I
don't know whatever users you have but I'm going to try to log in please again keep in mind the same
is gonna work with our register functionality.
There's no point for me each and every video repeat that so I'm going to go with logging and go john
g mail dot com.
Now let me remember the password if everything is correct I'm going to have you are logged in whatever
the user name was and I can have shopped away my friend.
Now we're gonna head over back and we're going to try to in fact sign in with a wrong password.
So let's start that John and you know I think I can close the console.
Can I have a g mail.
Then again we're gonna have a secret one or whatever just some wrong password and there was an error.
Please try again.
And if you'd like to close the alert would just click on close button.