Manage rule (#1359)

environments/ppa-mbqj77/deployments/1
Xavier Guimard 7 years ago
parent b9e2e91844
commit 344b9db804
  1. 7
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/TOTP.pm
  2. 7
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/U2F.pm

@ -21,7 +21,12 @@ has prefix => ( is => 'ro', default => 'totp' );
sub init {
my ($self) = @_;
if ( $self->conf->{totp2fActivation} eq '1' ) {
# If self registration is enabled and "activation" is simply set to
# "enabled", replace the rule to detect if user has register its key
if ( $self->conf->{totpSelfRegistration}
and $self->conf->{totp2fActivation} eq '1' )
{
$self->conf->{totp2fActivation} = '$_totp2fSecret';
}
$self->conf->{totp2fInterval} ||= 30;

@ -27,7 +27,12 @@ has prefix => ( is => 'ro', default => 'u' );
sub init {
my ($self) = @_;
if ( $self->conf->{u2fActivation} eq '1' ) {
# If self registration is enabled and "activation" is simply set to
# "enabled", replace the rule to detect if user has register its key
if ( $self->conf->{u2fSelfRegistration}
and $self->conf->{u2fActivation} eq '1' )
{
$self->conf->{u2fActivation} = '$_u2fKeyHandle and $_u2fUserKey';
}
return 0

Loading…
Cancel
Save