use Catalyst::Exception ();
use Digest ();
-__PACKAGE__->mk_accessors(qw/_config realm/);
+has [qw/_config realm/] => ( is => 'rw' );
-sub new {
+sub BUILDARGS {
my ($class, $config, $app, $realm) = @_;
-
+
+ # Note _config is horrible back compat hackery!
- my $self = { _config => $config };
- bless $self, $class;
-
- $self->realm($realm);
-
+ { realm => $realm, _config => $config };
+}
+
+sub BUILD {
+ my ($self, $args) = @_;
$self->_config->{'password_field'} ||= 'password';
$self->_config->{'password_type'} ||= 'clear';
$self->_config->{'password_hash_type'} ||= 'SHA-1';
package Catalyst::Authentication::User;
-
-use strict;
-use warnings;
-use base qw/Class::Accessor::Fast/;
+use Moose;
+ use Scalar::Util qw/refaddr/;
+use namespace::autoclean;
## auth_realm is the realm this user came from.
-__PACKAGE__->mk_accessors(qw/auth_realm store/);
+has [qw/auth_realm store/] => ( is => 'rw' );
## THIS IS NOT A COMPLETE CLASS! it is intended to provide base functionality only.
## translation - it won't work if you try to use it directly.
return $self->get_object(@_);
}
- ## Backwards Compatibility
- ## you probably want auth_realm, in fact. but this does work for backwards compatibility.
- ## store should be a read-write accessor - so it was moved to mk_accessors
- ##sub store {
- ## my ($self) = @_;
- ## return $self->auth_realm->{store};
- ##}
+ sub AUTOLOAD {
+ my $self = shift;
+ (my $method) = (our $AUTOLOAD =~ /([^:]+)$/);
+ return if $method eq "DESTROY";
- my $obj = $self->obj;
- # Don't bother unless we have a backing object
- return if refaddr($obj) eq refaddr($self);
-
- $obj->$method(@_);
-}
-
+__PACKAGE__->meta->make_immutable;
+ __PACKAGE__;
__END__
use Tie::RefHash;
use Class::Inspector;
use Catalyst::Authentication::Realm;
+use namespace::autoclean;
+
+has _user => ( is => 'rw' );
- our $VERSION = "0.10012";
+ our $VERSION = "0.10016";
sub set_authenticated {
my ( $c, $user, $realmname ) = @_;