remove she-bang lines.
[catagits/Catalyst-Plugin-Authentication.git] / lib / Catalyst / Plugin / Authentication.pm
index 27478f0..5c9c880 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 package Catalyst::Plugin::Authentication;
 
 use base qw/Class::Accessor::Fast Class::Data::Inheritable/;
@@ -21,7 +19,7 @@ use Class::Inspector;
 #      constant->import(have_want => eval { require Want });
 #}
 
-our $VERSION = "0.10000";
+our $VERSION = "0.10002";
 
 sub set_authenticated {
     my ( $c, $user, $realmname ) = @_;
@@ -40,32 +38,10 @@ sub set_authenticated {
         $c->save_user_in_session($user, $realmname);
     }
     $user->auth_realm($realmname);
-    $user->store(ref($c->auth_realms->{$realmname}{'store'}));
     
     $c->NEXT::set_authenticated($user, $realmname);
 }
 
-sub _should_save_user_in_session {
-    my ( $c, $user ) = @_;
-
-    $c->_auth_sessions_supported
-    and $c->config->{authentication}{use_session}
-    and $user->supports("session");
-}
-
-sub _should_load_user_from_session {
-    my ( $c, $user ) = @_;
-
-    $c->_auth_sessions_supported
-    and $c->config->{authentication}{use_session}
-    and $c->session_is_valid;
-}
-
-sub _auth_sessions_supported {
-    my $c = shift;
-    $c->isa("Catalyst::Plugin::Session");
-}
-
 sub user {
     my $c = shift;
 
@@ -149,7 +125,10 @@ sub find_user {
 sub _user_in_session {
     my $c = shift;
 
-    return unless $c->_should_load_user_from_session;
+    return unless
+        $c->isa("Catalyst::Plugin::Session")
+        and $c->config->{authentication}{use_session}
+        and $c->session_is_valid;
 
     return $c->session->{__user};
 }
@@ -168,10 +147,7 @@ sub auth_restore_user {
     
     # this sets the realm the user originated in.
     $user->auth_realm($realmname);
-    ## compatibility - some pre 0.10 store / credentials may need the store name,
-    ## this is not used by the current api in any form.
-    $user->store(ref($c->auth_realms->{$realmname}{'store'}));
-    
+        
     return $user;
 
 }