}
} else {
# Set an error message
- $c->stash(error_msg => "Empty username or password.");
+ $c->stash(error_msg => "Empty username or password.")
+ unless ($c->user_exists);
}
# If either of above don't work out, send to the login page
=head2 Try Out Authentication
The development server should have reloaded each time we edited one of
-the Controllers in the previous section. Now trying going to
+the Controllers in the previous section. Now try going to
L<http://localhost:3000/books/list> and you should be redirected to the
login page, hitting Shift+Reload or Ctrl+Reload if necessary (the "You
are already logged in" message should I<not> appear -- if it does, click
$user->update;
}
-EncodedColumn lets us simple call C<$user->check_password($password)>
+EncodedColumn lets us simply call C<$user->check_password($password)>
to see if the user has supplied the correct password, or, as we show
above, call C<$user->update($new_password)> to update the hashed
password stored for this user.
most recent version of the Catalyst Tutorial can be found at
L<http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial/>.
-Copyright 2006-2010, Kennedy Clark, under Creative Commons License
+Copyright 2006-2010, Kennedy Clark, under the
+Creative Commons Attribution Share-Alike License Version 3.0
(L<http://creativecommons.org/licenses/by-sa/3.0/us/>).