From 58d4b4aaf372a51d4cccc9d9d5b37aa0281a9aab Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 3 Aug 2012 15:08:51 -0400 Subject: [PATCH] SIP re-login fetches correct auth session After a login session expires and the SIP server logs in again to acquire a new authtoken, be sure to use the new authtoken when fetching the new session object. Otherwise, the login_session is left undef and you may see errors like this when checking in items: Can't call method "ws_ou" on an undefined value at /usr/local/share/perl/5.10.1/OpenILS/SIP/Transaction/Checkin.pm line 77. Incidentally, the checkin code is the only code that references $sip_handler->{login_session}. And the problem listed above only occurs when the login session expires just prior to a checkin call. In any other scenario, the login_session would ultimately get repaired. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- Open-ILS/src/perlmods/lib/OpenILS/SIP.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm index 37375064d3..da2528c57a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm @@ -244,9 +244,11 @@ sub login { my $key = $response->{payload}->{authtoken}; syslog('LOG_INFO', "OILS: Login succeeded for $username : authkey = $key"); + $self->{authtoken} = $key; + $self->fetch_session; # to cache the login - return $self->{authtoken} = $key; + return $key; } # -- 2.43.2