If this wasn't a patch in RT, I wouldn't be applying it
[catagits/Catalyst-Plugin-Authentication.git] / lib / Catalyst / Authentication / Credential / Remote.pm
index b4266c6..873f37e 100644 (file)
@@ -45,7 +45,7 @@ sub authenticate {
     my $remuser;
     if ($self->source eq "REMOTE_USER") {    
         # compatibility hack:
-        if (defined($c->engine->env)) {
+        if ($c->engine->can('env') && defined($c->engine->env)) {
             # BEWARE: $c->engine->env was broken prior 5.80005
             $remuser = $c->engine->env->{REMOTE_USER};
         }
@@ -104,9 +104,8 @@ sub authenticate {
             $usr = $1;
         }
     }
-    
-    $authinfo->{id} = $authinfo->{ $self->username_field } = $usr;
-    $authinfo->{remote_user} = $remuser; # just to keep the original value
+
+    $authinfo->{ $self->username_field } = $usr;
     my $user_obj = $realm->find_user( $authinfo, $c );
     return ref($user_obj) ? $user_obj : undef;
 }