Could anyone provide some insight on why this might be failing? I'm trying to use Authentication::Store::Minimal just to test authentication, following along with the examples in the Catalyst book by Jon Rockway.
$c->login continues to fail. Instead I get this error from the debug
server: [debug] User 'HASH(0x2460d20)' doesn't exist in the default store.
My login controller's relevant code is thus:
\\\\\\\\\\\ start code >
sub index : Private {
my ( $self, $c ) = @_;
my $username = $c->request->param('username') || '';
my $password = $c->request->param('password') || '';
if ($username && $password) {
# attempt to log user in
if ($c->login({
username => $username,
password => $password,
})) {
$c->response->redirect($c->uri_for('/portal'));
return
}
else {
# set an error message
$c->stash->{error} = 'Bad username or password';
}
}
# if either of the above don't work out, send back to login page
$c->stash->{message} .= 'Welcome, User. Please Log In.';
$c->stash->{username} = $c->request->param('username');
$c->stash->{template} = 'login.tt';
}
/////////// < end code
I am expecting that my login would succeed, but this is not the case.
Bear in mind that Sessions appear to be working perfectly.
Any insights? The relevant parts of my primary application file is as
shown below:
\\\\\\\\\\\ start code >
use Catalyst qw/
-Debug
ConfigLoader
Static::Simple
StackTrace
Session
Session::State::Cookie
Session::Store::DBIC
Authentication
Authentication::Store::Minimal
Authentication::Credential::Password
/;
our $VERSION = '0.01';
__PACKAGE__->config( name => 'ABCweb' );
__PACKAGE__->config(
session => {
flash_to_stash => 1,
dbic_class => 'DB::Sessions',
},
);
__PACKAGE__->config->{authentication}{users} = {
'tommy' => {
password => 'password'
}
};
/////////// < end code
signature.asc
Description: OpenPGP digital signature
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
