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

J. Shirley jshirley at gmail.com
Tue Nov 25 18:22:21 GMT 2008


On Tue, Nov 25, 2008 at 9:35 AM, Mark Beihoffer <mbeihoffer at gmail.com> wrote:
> 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
>

Hi Mark,

Can you also send the related snippet from config (everything in the
'Plugin::Authentication' key)?
That will tell us what store and credential you are using, so we don't
have to guess :)

The code to the authenticate call looks fine, so perhaps something in
the config is the culprit.  Obviously we want the error messages to be
more helpful, so I'd like to also solve why you aren't getting a
helpful message, too.

Thanks,
-J



More information about the Catalyst mailing list