So how did you make out with the challenge?
Hopefully you didn't find it terribly difficult.
Well, in order to make it work, what I did was change basically three files.
The first one is here.
Render don't go on the front end.
And we have this template data.
And this is a struct that contains information that's passed to every single template.
And one of those is if is authenticated, which is an end.
So I could have simply changed what happens down here and add default data.
Where I set TD is a dedicated equal to one.
I could make that the user because that's what we're actually storing in this special value user.
But I didn't do that.
I wanted to make things really clear.
So instead I added another field here and I just called the user ID and I made it an end.
And then down here where I add my default data, I simply added this one TD user ID is equal to app
dot session.
Don't get it, and I handed it the context, our context, and I looked for user I.D. and that populates
and by default that will be set to zero if we don't actually execute this statement.
But again, if you want to be really, really safe or make it clear what's going on, t the user ID
equals zero.
So that was the first file that I changed and the next file that I changed was just in one dash user
page, which HTML and it's right down here in the document add event listener.
I just put an if statement right here.
If ID is not exactly equal to and then since it's an end I just wrapped it in in quotation marks and
I pulled the user I.D. from the default data.
Close my quotes and put some curly brackets around everything and indented for formatting, and that's
all I had to do.
So now if I start my application, maybe start.
And go back to the Web browser and go to the admin page for a menu and choose all users.
And I have to log in the example dot com password, so if I go to the admin menu and choose all users
and click on myself, I should have that forum populated with data.
But this time I should not see the delete button.
And that's exactly what I get.
Perfect.
So that was pretty straightforward.
So now we need to move on to actually capturing the information from this form, calling the backend
API and updating a user.
OK, so we'll get started on that in the next lecture.