Append parameter test & error msg
This commit is contained in:
parent
2672fa006b
commit
095b1d2531
|
@ -268,13 +268,16 @@ sub run {
|
|||
|
||||
# Delete TOTP
|
||||
elsif ( $action eq 'delete' ) {
|
||||
my $epoch = $req->param('epoch');
|
||||
|
||||
# Check if unregistration is allowed
|
||||
unless ( $self->conf->{totp2fUserCanRemoveKey} ) {
|
||||
return $self->p->sendError( $req, 'notAuthorized', 400 );
|
||||
}
|
||||
|
||||
my $epoch = $req->param('epoch')
|
||||
or return $self->p->sendError( $req, '"epoch" parameter is missing',
|
||||
400 );
|
||||
|
||||
# Read existing 2FDevices
|
||||
$self->logger->debug("Loading 2F Devices ...");
|
||||
my $_2fDevices;
|
||||
|
|
|
@ -254,7 +254,9 @@ sub run {
|
|||
return $self->p->sendError( $req, 'notAuthorized', 200 );
|
||||
}
|
||||
|
||||
my $epoch = $req->param('epoch');
|
||||
my $epoch = $req->param('epoch')
|
||||
or return $self->p->sendError( $req, '"epoch" parameter is missing',
|
||||
400 );
|
||||
|
||||
# Read existing 2FDevices
|
||||
$self->logger->debug("Looking for 2F Devices ...");
|
||||
|
|
|
@ -137,13 +137,16 @@ sub run {
|
|||
}
|
||||
|
||||
elsif ( $action eq 'delete' ) {
|
||||
my $epoch = $req->param('epoch');
|
||||
|
||||
# Check if unregistration is allowed
|
||||
unless ( $self->conf->{yubikey2fUserCanRemoveKey} ) {
|
||||
return $self->p->sendError( $req, 'notAuthorized', 400 );
|
||||
}
|
||||
|
||||
my $epoch = $req->param('epoch')
|
||||
or return $self->p->sendError( $req, '"epoch" parameter is missing',
|
||||
400 );
|
||||
|
||||
# Read existing 2FDevices
|
||||
$self->logger->debug("Looking for 2F Devices ...");
|
||||
my $_2fDevices;
|
||||
|
|
Loading…
Reference in New Issue
Block a user