Commit e1e72e50 authored by Kevin Falcone's avatar Kevin Falcone
Browse files

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).
parent 5a3a85c3
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
......
......@@ -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 )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment