# constant->import(have_want => eval { require Want });
#}
-our $VERSION = "0.10004";
+our $VERSION = "0.10005";
sub set_authenticated {
my ( $c, $user, $realmname ) = @_;
}
if ( $c->isa("Catalyst::Plugin::Session")
- and $c->config->{authentication}{use_session}
+ and $c->config->{'Plugin::Authentication'}{'use_session'}
and $user->supports("session") )
{
$realm->save_user_in_session($c, $user);
if (
$c->isa("Catalyst::Plugin::Session")
- and $c->config->{authentication}{use_session}
+ and $c->config->{'Plugin::Authentication'}{'use_session'}
and $c->session_is_valid
) {
delete @{ $c->session }{qw/__user __user_realm/};
return unless
$c->isa("Catalyst::Plugin::Session")
- and $c->config->{authentication}{use_session}
+ and $c->config->{'Plugin::Authentication'}{'use_session'}
and $c->session_is_valid;
return $c->session->{__user};
## make classdata where it is used.
$app->mk_classdata( '_auth_realms' => {});
- my $cfg = $app->config->{'Plugin::Authentication'} ||= $app->config->{'authentication'} ||= {};
+ my $cfg = $app->config->{'Plugin::Authentication'};
+ if (!defined($cfg)) {
+ if (exists($app->config->{'authentication'})) {
+ $cfg = $app->config->{'authentication'};
+ $app->config->{'Plugin::Authentication'} = $app->config->{'authentication'};
+ } else {
+ $cfg = {};
+ }
+ }
- $cfg->{use_session} = 1;
+ # old default was to force use_session on. This must remain for that
+ # reason - but if use_session is already in the config, we respect it's setting.
+ if (!exists($cfg->{'use_session'})) {
+ $cfg->{'use_session'} = 1;
+ }
if (exists($cfg->{'realms'})) {
foreach my $realm (keys %{$cfg->{'realms'}}) {
Authentication
/;
- __PACKAGE__->config->{authentication} =
+ __PACKAGE__->config->{'Plugin::Authentication'} =
{
default_realm => 'members',
realms => {
You can accomplish this simply by installing the DBIx::Class Store and
changing your config:
- __PACKAGE__->config->{authentication} =
+ __PACKAGE__->config->{'Plugin::Authentication'} =
{
default_realm => 'members',
realms => {
=head1 CONFIGURATION
# example
- __PACKAGE__->config->{authentication} =
+ __PACKAGE__->config->{'Plugin::Authentication'} =
{
default_realm => 'members',
realms => {
Return the store whose name is 'default'.
-This is set to C<< $c->config->{authentication}{store} >> if that value exists,
+This is set to C<< $c->config->{'Plugin::Authentication'}{store} >> if that value exists,
or by using a Store plugin:
# load the Minimal authentication store.