allow the realm to use session even if main auth module doesn't
[catagits/Catalyst-Plugin-Authentication.git] / lib / Catalyst / Authentication / Realm / Compatibility.pm
CommitLineData
e0499ed6 1package Catalyst::Authentication::Realm::Compatibility;
810966b5 2
3use strict;
4use warnings;
810966b5 5
e0499ed6 6use base qw/Catalyst::Authentication::Realm/;
810966b5 7
8## very funky - the problem here is that we can't do real realm initialization
9## but we need a real realm object to function. So - we kinda fake it - we
10## create an empty object -
11sub new {
12 my ($class, $realmname, $config, $app) = @_;
13
14 my $self = { config => $config };
15 bless $self, $class;
16
9a37ffba 17 $self->config->{'use_session'} = $app->config->{'Plugin::Authentication'}{'use_session'} || '1';
810966b5 18 $self->name($realmname);
19
20 return $self;
21}
22
23__PACKAGE__;
24
2c7d23af 25__END__
26
27=pod
28
29=head1 NAME
30
e0499ed6 31Catalyst::Authentication::Realm::Compatibility - Compatibility realm object
2c7d23af 32
33=head1 DESCRIPTION
34
35An empty realm object for compatibility reasons.
36
37=head1 METHODS
38
d2ca09b8 39=head2 new( )
2c7d23af 40
41Returns a, basically empty, realm object.
42
2c7d23af 43=cut