From 62bda1b5287e1b85edbab5176ffad648afd0169e Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Tue, 19 Mar 2024 19:50:24 -0500 Subject: [PATCH] Use the URL for the `set_list` route without `https?://` for the TOTP issuer. --- lib/WeBWorK/ContentGenerator/TwoFactorAuthentication.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/WeBWorK/ContentGenerator/TwoFactorAuthentication.pm b/lib/WeBWorK/ContentGenerator/TwoFactorAuthentication.pm index 08e22e8a01..3e52db92b1 100644 --- a/lib/WeBWorK/ContentGenerator/TwoFactorAuthentication.pm +++ b/lib/WeBWorK/ContentGenerator/TwoFactorAuthentication.pm @@ -54,7 +54,7 @@ sub pre_header_initialize ($c) { $c->authen->session->{otp_secret} ? (secret => $c->authen->session->{otp_secret}) : ()); $c->authen->session(otp_secret => $totp->secret); - my $otp_link = $totp->generate_otp($c->authen->{user_id}, $ce->{courseName}); + my $otp_link = $totp->generate_otp($c->authen->{user_id}, $c->url_for('set_list')->to_abs =~ s|https?://||r); my $img_data = do { local $SIG{__WARN__} = sub { };