Add an example of how to call authorization_required_response (you used to just be...
Tomas Doran [Wed, 10 Sep 2008 15:46:35 +0000 (15:46 +0000)]
Changes
Todo
lib/Catalyst/Authentication/Credential/HTTP.pm

diff --git a/Changes b/Changes
index 4be501e..7f9af0e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -3,6 +3,8 @@
      when calling $c->authenticate. Docs and tests for this.
    - Clean up documentation of options inherited from 
      Catalyst::Authentication::Credential::Password
+   - Added an example of calling methods in the credential module from a 
+     controller to the POD.
 
 1.002  2008-09-03
    - Fix the assumptions that the password field is named password when doing 
diff --git a/Todo b/Todo
index c87e4a8..fe959cf 100644 (file)
--- a/Todo
+++ b/Todo
@@ -1,6 +1,4 @@
 . Document md5'd passwords for digest stuff
-. Port work's apps.
-. Document how to find the credential module, so that you can call authorization_required_response if you want to.
 . Add deprecation notice to old module.
 . document & test authorization_required_message
 . Test $self->_config->{authorization_required_message} + authorization_required_message = undef does not stamp on body.
index f1ff62b..806f355 100644 (file)
@@ -410,6 +410,16 @@ for Catalyst.
 
         do_stuff();
     }
+    
+    sub always_auth : Local {
+        my ( $self, $c ) = @_;
+        
+        # Force authorization headers onto the response so that the user
+        # is asked again for authentication, even if they successfully
+        # authenticated.
+        my $realm = $c->get_auth_realm('example');
+        $realm->credential->authorization_required_response($c, $realm);
+    }
 
     # with ACL plugin
     __PACKAGE__->deny_access_unless("/path", sub { $_[0]->authenticate });