=back
+=head1 IMPORTANT NOTE
+
+Since this tutorial was written, there has been a new Authentication
+API released (Catalyst::Plugin::Authentication version 0.1 and later).
+Some of this tutorial does not work with this API, and requires
+minimal changes. For an example application that uses the new API see
+L<http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/NewAuthApp/NewAuthApp-0.01.tar.gz>. It
+is recommended that you read this tutorial first, and then download
+the source code linked above to understand the differences.
+
=head1 DESCRIPTION
Now that we finally have a simple yet functional application, we can
# If the username and password values were found in form
if ($username && $password) {
# Attempt to log the user in
- if ($c->login($username, $password)) {
+ if ($c->authenticate({ username => $username,
+ password => $password} )) {
# If successful, then let them use the application
$c->response->redirect($c->uri_for('/books/list'));
return;
}
This controller fetches the C<username> and C<password> values from the
-login form and attempts to perform a login. If successful, it redirects
-the user to the book list page. If the login fails, the user will stay
-at the login page but receive an error message. If the C<username> and
-C<password> values are not present in the form, the user will be taken
-to the empty login form.
+login form and attempts to authenticate the user. If successful, it
+redirects the user to the book list page. If the login fails, the user
+will stay at the login page but receive an error message. If the
+C<username> and C<password> values are not present in the form, the
+user will be taken to the empty login form.
Note that we could have used something like C<sub default :Private>;
however, the use of C<default> actions is discouraged because it does