@@ -, +, @@ --- koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc | 5 ++++- opac/svc/login | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc +++ a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc @@ -72,7 +72,10 @@ navigator.id.watch({ function (data) { window.location = '/cgi-bin/koha/opac-user.pl'; } - ); + ) + .fail(function() { var errstr = _("Could not login, perhaps your Persona email does not match your Koha one"); + alert(errstr); + }); }, onlogout: function () { window.location = '/cgi-bin/koha/opac-main.pl?logout.x=1'; --- a/opac/svc/login +++ a/opac/svc/login @@ -44,8 +44,14 @@ if ( $response->is_success ) { my $decoded_json = decode_json($content); my ( $userid, $cookie, $sessionID ) = checkauth( $query, 1, { borrow => 1 }, 'opac', $decoded_json->{'email'} ); - print $query->header( -cookie => $cookie ); - print $decoded_json; + if ($userid) { # a valid user has logged in + print $query->header( -cookie => $cookie ); + print $decoded_json; + } + else { +# logged in with an email that isn't associated with a borrower + die "Email not associated with a borrower"; + } } else { warn $response->status_line, "\n"; --