1 package Catalyst::Plugin::Authentication::Store::Minimal;
7 use Catalyst::Authentication::Store::Minimal ();
9 ## backwards compatibility
13 ### If a user does 'use Catalyst qw/Authentication::Store::Minimal/'
14 ### he will be proxied on to this setup routine (and only then --
15 ### non plugins should NOT have their setup routine invoked!)
16 ### Beware what we pass to the 'new' routine; it wants
17 ### a config has with a top level key 'users'. New style
18 ### configs do not have this, and split by realms. If we
19 ### blindly pass this to new, we will 1) overwrite what we
20 ### already passed and 2) make ->userhash undefined, which
22 ### Can't use an undefined value as a HASH reference at
23 ### lib/Catalyst/Authentication/Store/Minimal.pm line 38.
25 ### So only do this compatibility call if:
26 ### 1) we have a {users} config directive
28 ### Ideally we could also check for:
29 ### 2) we don't already have a ->userhash
30 ### however, that's an attribute of an object we can't
33 my $cfg = $c->config->{'Plugin::Authentication'}->{users}
34 ? $c->config->{'Plugin::Authentication'}
37 $c->default_auth_store( Catalyst::Authentication::Store::Minimal->new( $cfg, $c ) ) if $cfg;
42 foreach my $method (qw/ get_user user_supports find_user from_session /) {
44 *{$method} = sub { __PACKAGE__->default_auth_store->$method( @_ ) };
55 Catalyst::Plugin::Authentication::Store::Minimal - Compatibility shim
59 THIS IS A COMPATIBILITY SHIM. It allows old configurations of Catalyst
60 Authentication to work without code changes.
62 B<DO NOT USE IT IN ANY NEW CODE!>
64 Please see L<Catalyst::Authentication::Store::Minimal> for more information.