mcso has asked for the wisdom of the Perl Monks concerning the following question:
In lib/MyApp.pm, authentication is configured as following:[error] authenticate called with nonexistant realm: 'default'.
And my login/authentication code is as follows:__PACKAGE__->config( 'Plugin::Authentication' => { use_session => 1, default_realm => 'default', default => { credentials => { class => 'Password', password_field => 'Password', password_type => 'hashed', password_hash_type => 'SHA-1' }, store => { class => 'DBIx::Class', user_model => 'MyDB::Users', id_field => 'Username', use_userdata_from_session => 1 } } } );
Any suggestion of where the error might be would be greatly appreciated.sub base :Chained('/') :PathPart('myapp') :CaptureArgs(0) {} sub unauthenticated :Chained('base') :PathPart('authentication') :Capt +ureArgs(0) {} sub login :Chained('unauthenticated') :PathPart('login') :ActionClass( +'REST') {} sub login_POST { my $this = shift; my $c = shift; my $username = $c->request->data->{'username'} || ''; my $password = $c->request->data->{'password'} || ''; if($username eq '' || $password eq '') { $this->status_bad_request( $c, message => "Invalid username or password" ); $c->dispatch('end'); my $is_authenticated = $c->authenticate( { username => $username, password => $password } ); if(! $is_authenticated) { $this->status_bad_request( $c, message => "Invalid username or password" ); $c->dispatch('end'); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: [Catalyst] authenticate called with nonexistant realm: 'default'
by Your Mother (Archbishop) on Apr 14, 2014 at 18:23 UTC | |
by mcso (Novice) on Apr 15, 2014 at 06:25 UTC | |
by Your Mother (Archbishop) on Apr 16, 2014 at 17:36 UTC | |
by mcso (Novice) on Apr 24, 2014 at 06:56 UTC | |
by Anonymous Monk on Apr 24, 2014 at 07:41 UTC | |
|
Re: [Catalyst] authenticate called with nonexistant realm: 'default'
by Anonymous Monk on Apr 14, 2014 at 17:48 UTC |