If there is a stale "ses" cookie hanging around when a staff member logs
into the Angular client, it will be sent to the batch MARC edit handler
along with the active "eg.auth.token" cookie. We should check for and
prefer the latter in this particular code.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
my $r = shift;
my $cgi = new CGI;
- my $authid = $cgi->cookie('ses') || $cgi->param('ses');
+ my $authid = $cgi->cookie('eg.auth.token') || $cgi->cookie('ses') || $cgi->param('ses');
+ if ($authid =~ /^"(.+)"$/) { # came from eg2 login, is json encoded
+ $authid = $1;
+ }
# Avoid sending the HTML to the caller. Final response will
# will just be the cache key or HTTP_BAD_REQUEST on error.