From 2128ca18adf4aa8a92ce371e937fb33ecb8b7586 Mon Sep 17 00:00:00 2001 From: Jaimos Skriletz Date: Tue, 6 Aug 2024 19:13:57 -0600 Subject: [PATCH] Don't log out items in $authen{user_module} not in $authen{admin_module} When looping through $authen{user_module} for the admin course, modules not in $authen{admin_module} can be logged and `authen_error` is set before attempting the next module. This can cause the logins to the admin course to fail under certain configurations. This removes both the logging and error message, and just attempts the next authentication method. --- lib/WeBWorK/Authen.pm | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/WeBWorK/Authen.pm b/lib/WeBWorK/Authen.pm index c5de75dd0e..f73cc16c91 100644 --- a/lib/WeBWorK/Authen.pm +++ b/lib/WeBWorK/Authen.pm @@ -154,17 +154,13 @@ sub verify { debug('BEGIN VERIFY'); - return $self->call_next_authen_method if !$self->request_has_data_for_this_verification_module; my $authen_ref = ref($self); - if ($c->ce->{courseName} eq $c->ce->{admin_course_id} - && !(grep {/^$authen_ref$/} @{ $c->ce->{authen}{admin_module} })) + if ( + !$self->request_has_data_for_this_verification_module + || ($c->ce->{courseName} eq $c->ce->{admin_course_id} + && !(grep {/^$authen_ref$/} @{ $c->ce->{authen}{admin_module} })) + ) { - $self->write_log_entry("Cannot authenticate into admin course using $authen_ref."); - $c->stash( - authen_error => $c->maketext( - 'There was an error during the login process. Please speak to your instructor or system administrator.' - ) - ); return $self->call_next_authen_method(); }