package Catalyst::Plugin::Authentication;
-
-use base qw/Class::Accessor::Fast/;
-
-__PACKAGE__->mk_accessors(qw/_user/);
-
-use strict;
-use warnings;
-
+use Moose::Role;
use MRO::Compat;
use Tie::RefHash;
use Class::Inspector;
use Catalyst::Authentication::Realm;
+use namespace::autoclean;
+
+has _user => ( is => 'rw' );
our $VERSION = "0.10016";
}
-# we can't actually do our setup in setup because the model has not yet been loaded.
-# So we have to trigger off of setup_finished. :-(
-sub setup {
+# We can't actually do our setup in setup because the model has not yet been loaded.
+# So we have to trigger before 'setup_finalize'.
+before 'setup_finalize' => sub {
my $app = shift;
+ $app->mk_classdata('_auth_initialized');
$app->_authentication_initialize();
- $app->next::method(@_);
-}
+};
## the actual initialization routine. whee.
sub _authentication_initialize {