Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- Registration System 6:08
- Securing Passwords 5:38
- Login Systems 4:53
- Building a JWT 4:52
- Authentication Review 5 questions
- Working with Cookies 4:24
- Require Authentication 5:22
- Logging Out 3:13
- Flash Messages 5:29
- Cookies and Flash Messages 3 questions
- User Profile 9:30
- Reset Password 4:42
- Password Hashing 1 objective

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Giving the user a way they can update their password is important. In this video, we will create a User Profile page with a password reset form.
Note on the Code
We could also have done
function requireAdmin() {
requireAuth();
...
}
If we want to use the $session object we need to tell the function to pull that object from the global scope. (See the later video where we update this function: starting at 1:45)
global $session;
New Function to Display Success
function display_success() {
global $session;
if(!$session->getFlashBag()->has('success')) {
return;
}
$messages = $session->getFlashBag()->get('success');
$response = '<div class="alert alert-success alert-dismissable">';
foreach ($messages as $message) {
$response .= "{$message}<br>";
}
$response .= '</div>';
return $response;
}
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Martin Ulč
15,700 PointsFunction decodeJwt completely destroy my $_ENV variable
Posted by Martin UlčMartin Ulč
15,700 Points0 Answers
-
Brandyn Lordi
17,778 Points1 Answer
-
MOD
Jonathan Grieve
Treehouse Moderator 91,254 Points2 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up