<%doc> The MFA authentication login page. Posting to it will, if the OTP is valid, redirect the user to the page (with arguments intact) encoded in the "next" parameter. The user is sent here by the autohandler "Auth" callback. \ <%ARGS> $totpmfa_otp => '' $actions => undef $next => '' \ <%INIT> my $Digits = RT->Config->Get('TOTPMFA_Digits') || 6; if (defined $ARGS{'totpmfa_otp'}) { my ($OK, $Message) = RT::Extension::TOTPMFA::MFALogin(\%session, $ARGS{'totpmfa_otp'}); if ($OK) { RT->Logger->info('TOTPMFA - Successful OTP MFA login for ' . $session{'CurrentUser'}->Name . ' from ' . $ENV{'REMOTE_ADDR'}); my $next = RT::Interface::Web::RemoveNextPage($ARGS{'next'}); $next = $next->{'url'} if (ref $next); $m->callback( %ARGS, CallbackName => 'SuccessfulLogin', CallbackPage => '/autohandler', RedirectTo => \$next ); if ($next) { RT::Interface::Web::Redirect($next); } else { RT::Interface::Web::Redirect(RT->Config->Get('WebURL')); } } elsif ($Message) { $ARGS{'actions'} = [$Message]; } } \ % if ( RT::Interface::Web::MobileClient() || $ARGS{'mobile'} ) { % # Mobile view. Derived from RT 5.0.1 /m/_elements/login. \ <&| /m/_elements/wrapper, title => loc('Multi-factor authentication'), show_home_button => 0 &>
<& /Elements/ListActions, title => loc('Error'), titlebox => { class => 'error', hideable => 0 }, actions => $actions, &> \
<&| /Widgets/TitleBox, title => loc('One-time passcode'), hideable => 0 &> <& /Elements/LoginRedirectWarning, %ARGS &>
/NoAuth/TOTPMFALogin.html">
<&|/l&>One-time passcode:" size="20" maxlength="45" pattern="(\d{<% $Digits %>,<% $Digits %>}|[a-z]{32,45})" />
<& /Elements/Submit, Label => loc('Login')&>
<& /m/_elements/full_site_link &> \ % } else { % # Desktop (non-mobile) view. Derived from RT 5.0.1 /Elements/Login. \ <& /Elements/Header, Title => loc('Multi-factor authentication'), Focus => '#totpmfa_otp', RichText => 0 &>
<& /Elements/ListActions, title => loc('Error'), titlebox => { class => 'error', hideable => 0 }, actions => $actions &>
<&| /Widgets/TitleBox, title => loc('One-time passcode'), hideable => 0 &> <& /Elements/LoginRedirectWarning, %ARGS &>
<&|/l&>One-time passcode:
" size="20" maxlength="45" pattern="(\d{<% $Digits %>,<% $Digits %>}|[a-z]{32,45})" />
<& /Elements/Footer, Menu => 0 &> \ % }