From 1e0c4efcf75bb602266290e5da04dacfa1aae937 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Fri, 11 Sep 2020 12:21:24 -0400 Subject: [PATCH] LP1880726: Support eg2 cookie 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 Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm index ae91b36a94..5bd561a3ef 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm @@ -55,7 +55,10 @@ sub handler { 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. -- 2.11.0