Skip to content

Commit

Permalink
Don't log out items in $authen{user_module} not in $authen{admin_module}
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
somiaj committed Aug 7, 2024
1 parent 0e92922 commit 2128ca1
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/WeBWorK/Authen.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 2128ca1

Please sign in to comment.