Comments
[catagits/Catalyst-Authentication-Credential-FBConnect.git] / lib / Catalyst / Authentication / Credential / FBConnect.pm
index 779c486..869d466 100644 (file)
@@ -2,9 +2,12 @@ package Catalyst::Authentication::Credential::FBConnect;
 use strict;
 use warnings;
 
-use Moose;
+use Moose; # Moose gave you strict and warnings already
 
-has _config => ( is => 'rw' );
+# This _config thing just isn't needed.. It's a throwback in the code you've
+# cargo culted to the days when the auth credential used to be a plugin
+# on the app class :/
+has _config => ( is => 'rw' ); # Do these actually need to be rw??
 has debug => ( is => 'rw' );
 has key => ( is => 'rw' );
 has secret => ( is => 'rw' );
@@ -14,12 +17,13 @@ has fbconnect => ( is => 'rw' );
 use WWW::Facebook::API;
 use Catalyst::Exception ();
 
-sub new {
+sub new { # Writing your own ->new method makes Moose sad, implement BUILDARGS
+          # and BUILD instead
        my ($class, $config, $c, $realm) = @_;
 
        my $self = { _config => {
                %{ $config },
-               %{ $realm->{config} }
+               %{ $realm->{config} } # Ewww, gross hack to steal the realms config too.
        } };
 
        bless $self, $class;
@@ -36,7 +40,7 @@ sub new {
                api_key => $self->key,
                secret => $self->secret
        ) );
-       
+
        return $self;
 }
 
@@ -55,10 +59,10 @@ sub authenticate {
                        session_uid => $self->fbconnect->session_uid,
                        session_key => $self->fbconnect->session_key,
                        session_expires => $self->fbconnect->session_expires
-               };      
+               };
 
                my $user_obj = $realm->find_user( $user, $c );
-               
+
                return $user_obj if ref $user_obj;
 
                $c->log->debug( 'Verified FBConnect itentity failed' ) if $self->debug;
@@ -145,7 +149,7 @@ Bogdan Lucaciu E<lt>bogdan@sinapticode.comE<gt>
 
 =head1 COPYRIGHT
 
-Copyright (c) 2009 Sinapticode. All rights reserved 
+Copyright (c) 2009 Sinapticode. All rights reserved
 
 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.