# 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, $password)) {
# If successful, then let them use the application
$c->response->redirect($c->uri_for('/books/list'));
return;