Test if a 2FA exists (#2716)

This commit is contained in:
Christophe Maudoux 2022-03-03 23:05:19 +01:00
parent 399fc52a00
commit 9c512f8e5b
1 changed files with 3 additions and 4 deletions

View File

@ -385,8 +385,7 @@ sub run {
MSG => $self->canUpdateSfa($req) || 'choose2f',
ALERT => ( $self->canUpdateSfa($req) ? 'warning' : 'positive' ),
MODULES => [
map {
{
map { {
CODE => $_->prefix,
LOGO => $_->logo,
LABEL => $_->label
@ -441,7 +440,7 @@ sub _choice {
return $self->p->do(
$req,
[
sub { $res }, 'controlUrl',
sub { $res }, 'controlUrl',
'buildCookie', @{ $self->p->endAuth },
]
);
@ -503,7 +502,7 @@ sub _displayRegister {
return [ 302, [ Location => $self->conf->{portal} . $am[0]->{URL} ], [] ]
if (
@am == 1
and not( $req->userData->{_2fDevices}
and not( $req->userData->{_2fDevices} =~ /\w+/
or $req->data->{sfRegRequired} )
);