[Catalyst] "Can't call method "user_is_restorable"

Mark Beihoffer mbeihoffer at gmail.com
Tue Nov 25 17:35:44 GMT 2008


Hello,

I've encountered a problem with Catalyst::Plugin::Authentication
0.10008 that I can't seem to resolve.

When logging in or out now I get these error messages:

Caught exception in TCLegal::Controller::Logout->index "Can't call
method "user_is_restorable" on an undefined value at
/usr/local/libdata/perl5/site_perl/Catalyst/Plugin/Authentication.pm
line 169."

and

An error has occurred. We're terribly sorry about that, but it's one
of those things that happens from time to time. Let's just hope the
developers test everything properly before release...

Here's the error message, on the off-chance that it means something to
you: undef error - Can't call method "user_is_restorable" on an
undefined value at
/usr/local/libdata/perl5/site_perl/Catalyst/Plugin/Authentication.pm
line 169.

What am I doing wrong? I've updated all the modules I can think of,
and nothing seems to fix this problem.

It happens under mod_perl with an Apache Virtualhost configuration,
and also under the test server.

>From myapp.conf

use parent qw/Catalyst/;
use Catalyst qw/-Debug
                ConfigLoader
                Static::Simple
                StackTrace

                Authentication
                Authorization::Roles
                Authorization::ACL

                Session
                Session::Store::FastMmap
                Session::State::Cookie

                /;

and here's the code around my ->authenticate call:

sub index :Path :Args(0) {
    my ($self, $c) = @_;

    # Get the username and password from form
    my $username = $c->request->params->{username} || "";
    my $password = $c->request->params->{password} || "";

    # If the username and password values were found in form
    if ($username && $password) {
        # Attempt to log the user in
        if ($c->authenticate({ username => $username,
                               password => $password} )) {
            # If successful, then let them use the application
            $c->response->redirect($c->uri_for('/'));
            return;
        } else {
            # Set an error message
            $c->stash->{error_msg} = "Bad username or password.";
        }
    }



Thanks for any advice,

- Mark Beihoffer



More information about the Catalyst mailing list