From 8ec8da0491ad89604700b3e29a227966f6d84ba1 Mon Sep 17 00:00:00 2001 From: Perl Tidy Date: Wed, 5 Dec 2018 15:38:52 -0500 Subject: no bug - reformat all the code using the new perltidy rules --- Bugzilla/MFA/Duo.pm | 71 ++++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 36 deletions(-) (limited to 'Bugzilla/MFA/Duo.pm') diff --git a/Bugzilla/MFA/Duo.pm b/Bugzilla/MFA/Duo.pm index 19590944b..6b026f55b 100644 --- a/Bugzilla/MFA/Duo.pm +++ b/Bugzilla/MFA/Duo.pm @@ -18,58 +18,57 @@ use Bugzilla::DuoWeb; use Bugzilla::Error; sub can_verify_inline { - return 0; + return 0; } sub enroll { - my ($self, $params) = @_; + my ($self, $params) = @_; - # verify that the user is enrolled with duo - my $client = Bugzilla::DuoAPI->new( - Bugzilla->params->{duo_ikey}, - Bugzilla->params->{duo_skey}, - Bugzilla->params->{duo_host} - ); - my $response = $client->json_api_call('POST', '/auth/v2/preauth', { username => $params->{username} }); + # verify that the user is enrolled with duo + my $client = Bugzilla::DuoAPI->new( + Bugzilla->params->{duo_ikey}, + Bugzilla->params->{duo_skey}, + Bugzilla->params->{duo_host} + ); + my $response = $client->json_api_call('POST', '/auth/v2/preauth', + {username => $params->{username}}); - # not enrolled - show a nice error page instead of just throwing - unless ($response->{result} eq 'auth' || $response->{result} eq 'allow') { - print Bugzilla->cgi->header(); - my $template = Bugzilla->template; - $template->process('mfa/duo/not_enrolled.html.tmpl', { email => $params->{username} }) - || ThrowTemplateError($template->error()); - exit; - } + # not enrolled - show a nice error page instead of just throwing + unless ($response->{result} eq 'auth' || $response->{result} eq 'allow') { + print Bugzilla->cgi->header(); + my $template = Bugzilla->template; + $template->process('mfa/duo/not_enrolled.html.tmpl', + {email => $params->{username}}) + || ThrowTemplateError($template->error()); + exit; + } - $self->property_set('user', $params->{username}); + $self->property_set('user', $params->{username}); } sub prompt { - my ($self, $vars) = @_; - my $template = Bugzilla->template; + my ($self, $vars) = @_; + my $template = Bugzilla->template; - $vars->{sig_request} = Bugzilla::DuoWeb::sign_request( - Bugzilla->params->{duo_ikey}, - Bugzilla->params->{duo_skey}, - Bugzilla->params->{duo_akey}, - $self->property_get('user'), - ); + $vars->{sig_request} = Bugzilla::DuoWeb::sign_request( + Bugzilla->params->{duo_ikey}, Bugzilla->params->{duo_skey}, + Bugzilla->params->{duo_akey}, $self->property_get('user'), + ); - print Bugzilla->cgi->header(); - $template->process('mfa/duo/verify.html.tmpl', $vars) - || ThrowTemplateError($template->error()); + print Bugzilla->cgi->header(); + $template->process('mfa/duo/verify.html.tmpl', $vars) + || ThrowTemplateError($template->error()); } sub check { - my ($self, $params) = @_; + my ($self, $params) = @_; - return if Bugzilla::DuoWeb::verify_response( - Bugzilla->params->{duo_ikey}, - Bugzilla->params->{duo_skey}, - Bugzilla->params->{duo_akey}, - $params->{sig_response} + return + if Bugzilla::DuoWeb::verify_response( + Bugzilla->params->{duo_ikey}, Bugzilla->params->{duo_skey}, + Bugzilla->params->{duo_akey}, $params->{sig_response} ); - ThrowUserError('mfa_bad_code'); + ThrowUserError('mfa_bad_code'); } 1; -- cgit v1.2.3-24-g4f1b