All right, and once our log-in functionality works on the backend and we have tests that are more the
postman now set up everything on a frontend and micro, thirty seven million times functionality is
going to be almost almost the same.
There's just going to be some differences when it comes to the actual real wiring because this is a
different route.
But if you take a look at the code, it will match pretty much everything that we have already in registry
user and keep in mind that we already did all the heavy lifting.
We set up the state values.
We set up the local storage.
So this should be a smooth sailing.
And as far as the set up, like I said, start with logging user begin blah blah blah.
Set up the imports and not in the context.
I want to create my logging user and it will also be looking for current years.
Why?
Because we will use it in a register.
So in this case, I'm checking if member, if it's a member, logging user, if it's not.
Well, we already ran the register user.
Correct.
So let's start working on that.
And as a quick sign out, I'll try to set up everything on a frontend without having these two screens
because I'm noticing that we write so much code in the error.
And at the very end, I show you everything on a big screen anyway, so we might as well have all of
this real estate.
Now I might change my mind in a few videos, but for now we will do it this way where we'll write the
code.
So there's going to be no small screen over here.
And then once we're done, we're going to navigate to the big screen and I'll go over all the steps.
Now, the first thing that I want to do is actually closed, all my tabs and all that, so I want to
start from scratch.
We're looking for the source and first in context in the actions.
We want to create those actions correct.
So we want to go with logging, user began and blah blah blah.
So here's what I can do.
I can just copy and paste all of them.
So let me set up here copy and paste.
And keep in mind that we're only looking to change.
These writers want to have the register so set up.
My multiple cursors online, this is not going to be a register is going to be logged.
That's pretty much done as far as the actions are concerned.
Online, let's go to reduce her first online.
We're looking for login and then begin success and error, so that still stays the same.
So what's bad here are as well, and I'll copy them just so it can be disappointment.
And then in the app context, right off the register, I'll copy and paste and then let's keep on scrolling.
So we have clear alert.
Click on that, a registered user.
And now let's set up the log in user as well.
So let's go Konst logging user.
Now that is going to be a thing since there's going to be a fresh request.
And let's just say here, current users, so that's the user object that I'm going to be getting.
And then in here, let's go with log, and we're looking for current online user just so we can clearly
see that everything works.
Then let's add that function to our value object.
And then we want to navigate to the pages and more specifically, the register.
We want to import it.
So right after the registered user, we're going to go along and user and user, and let's keep on scrolling,
keep scrolling.
Where we have the Ornge submit, we have the current user at the moment, we're just logging.
Correct.
So what is the next step?
Well, we want to invoke logging user and we want to pass in the current user.
And let's save this.
I don't know.
Let's navigate to the big screen and let's test it out.
So at the moment, I have the dashboard page.
Go ahead.
Awesome.
And I'm actually looking for sir and I'll right away open up everything here, and it looks like I have
a user.
That's why we navigated the way.
It's not what I want to share with me.
Just remove everything.
And let me go back to the register.
And here let's pass in John G-mail dot com and my password.
And then if everything is correct, we should right away see this name, email and password.
And don't worry about this name.
Why?
Well, because remember in our controller, what are we looking for?
We only care about email and password.
Now, if you want, of course, you can remove it from the object and all that.
I just find it a waste of time since again in the controller.
We don't care about the name.
There's going to be no error if it is empty, and therefore I'll just pass it as it is.
And with this in place, we are done with our login functionality set up on the frontend.