- [Narrator] So right now you can tell that we actually
registered a user,
especially if you go back into the homepage.
You should see the email address of the user
that we just finished creating.
Now, it would be nice if we could capture the user's name,
we're asking for it in this input field called Display Name,
but we're not doing anything with it,
and that's because by default
the method
that authenticates
and creates user
only takes two fields.
We can't pass along that Display Name,
however, we can execute a new authentication method,
and then modify our
authentication record
so that it does include a Display Name.
There's actually a few other things that you can push,
you can push a photo, and it really,
usually any of the fields that you would be able to use
in some of the other authentication methods
will be available to you.
But we just want to add the Display Name of the user,
so we're going to modify this
so that information gets passed along.
So, user credentials,
what we'll do here is go ahead and execute a new method
so we'll issue a return statement
and we'll take a look at the credentials
that we received back
and we're interested in getting the user information
from those credentials.
Then we'll execute a new method called Update Profile.
And there it is right there.
And we'll pass along
the Display Name information
and we'll pass along the local variable
for the Display Name.
So, this Display Name is actually a field
that is in the authentication record,
as I mentioned there's other fields in there
and you can take a look at them if you want,
you can console log these user credentials
if you want to see all of the other properties
that you can pass and read,
so, but here, we're going to send another command
to update the profile
and then pass along our Display Name
so that that information is pushed over.
And what we want to do is
go ahead,
and then, this is also a promise,
so it will get another then statement
and that's when we will send people to the meetings.
Right, so, we've got sort of a promise
and then another promise inside our promise.
So hopefully, that's not too confusing.
There are a lot of punctuations here,
but that's just the way JavaScript works.
So this should work to allow us
to create a user
and actually push along the Display Name.
So let's try that.
Okay, so we'll hit Register,
it should take us back into Meetings,
and if we go to the Meeting Log,
we should see this new email here.
Let's see if it stored the Display Name as well.
So, we'll go back into the App,
and here we will look for Display Name.
So let's go ahead and save that.
And now you can see that it displays the Display Name
that the user entered
when they registered onto the site,
which I think is a lot better.