[Bps-public-commit] rt-authen-externalauth branch, master, updated. 0.23-1-ge1e72e5

Kevin Falcone falcone at bestpractical.com
Tue Aug 19 13:54:02 EDT 2014


The branch, master has been updated
       via  e1e72e500a43eb6381668494a3f95681fcf25d72 (commit)
      from  5a3a85c36f2e0abc43a0b0483b6e01e4d390ec54 (commit)

Summary of changes:
 CHANGES              | 4 ++++
 html/Elements/DoAuth | 3 +++
 2 files changed, 7 insertions(+)

- Log -----------------------------------------------------------------
commit e1e72e500a43eb6381668494a3f95681fcf25d72
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Tue Aug 19 13:46:11 2014 -0400

    Add a callback to run after a user logs in
    
    Because RT::Authen::ExternalAuth runs before core's
    AttemptPasswordAuthentication, the core "you're logged in!" callback
    never runs.  This means if you want to do something 'on login' you have
    no hook for RT::Authen::ExternalAuth users.
    
    We call the core SuccessfulLogin callback from RT::Authen::ExternalAuth
    so that your code should 'just work' in both scenarios.
    
    The DoAuth $next extraction is virtually identical to core, so should
    work for normal use cases (RTIR's code works on both core and with this
    change).

diff --git a/CHANGES b/CHANGES
index 911781e..3b07bfa 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+0.23_01
+ - Call core's autohandler/SuccessfulLogin callback after logging in a user.
+   Now code written to run after a core login also runs for external logins.
+
 0.23 2014-08-14
  - Packaging changes only
 
diff --git a/html/Elements/DoAuth b/html/Elements/DoAuth
index 0f6050b..49aaab5 100644
--- a/html/Elements/DoAuth
+++ b/html/Elements/DoAuth
@@ -14,6 +14,9 @@ unless($session{'CurrentUser'} && $session{'CurrentUser'}->Id) {
 
     ($val,$msg) = RT::Authen::ExternalAuth::DoAuth(\%session,$user,$pass);
     $RT::Logger->debug("Autohandler called ExternalAuth. Response: ($val, $msg)");
+    if ( $val ) {
+        $m->callback( %ARGS, CallbackName => 'SuccessfulLogin', CallbackPage => '/autohandler', RedirectTo => \$next );
+    }
 
     # 3.8.9 doesn't redirect to the specified page if request has one.
     RT::Interface::Web::Redirect( $next )

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list