Commit 3ec64aca authored by Christophe Maudoux's avatar Christophe Maudoux 🐛

Update icons

parent 983400e0
...@@ -74,38 +74,18 @@ sub run { ...@@ -74,38 +74,18 @@ sub run {
return [ 200, [ 'Content-Type' => 'application/json' ], [$challenge] ]; return [ 200, [ 'Content-Type' => 'application/json' ], [$challenge] ];
} }
if ( $action eq 'unregistration' ) { if ( $action eq 'unregistration' ) {
#my ( $resp, $challenge ); $self->p->updatePersistentSession(
#unless ($resp = $req->param('registration') $req,
#and $challenge = $req->param('challenge') ) {
#{ _u2fKeyHandle => '',
#return $self->p->sendError( $req, 'Missing registration parameter', _u2fUserKey => ''
#400 ); }
#} );
#$self->logger->debug("Get unregistration data $resp"); $self->userLogger->notice('U2F key unregistration succeed');
#$self->logger->debug("Get challenge $challenge"); return [
#eval { $challenge = JSON::from_json($challenge)->{challenge} }; 200, [ 'Content-Type' => 'application/json' ],
#if ($@) { ['{"result":1}']
#$self->userLogger->error("Bad challenge: $@"); ];
#return $self->p->sendError( $req, 'Bad challenge', 400 );
#}
#my $c = $self->crypter;
#if ( $c->setChallenge($challenge) ) {
#my ( $keyHandle, $userKey ) = $c->registrationVerify($resp);
#if ( $keyHandle and $userKey ) {
$self->p->updatePersistentSession(
$req,
{
_u2fKeyHandle => '',
_u2fUserKey => ''
}
);
$self->userLogger->notice('U2F key unregistration succeed');
return [
200, [ 'Content-Type' => 'application/json' ],
['{"result":1}']
];
#}
#}
my $err = Crypt::U2F::Server::Simple::lastError(); my $err = Crypt::U2F::Server::Simple::lastError();
$self->userLogger->warn("U2F Unregistration failed: $err"); $self->userLogger->warn("U2F Unregistration failed: $err");
return $self->p->sendError( $req, $err, 200 ); return $self->p->sendError( $req, $err, 200 );
...@@ -137,6 +117,7 @@ sub run { ...@@ -137,6 +117,7 @@ sub run {
} }
my $res = my $res =
( $req->datas->{crypter}->authenticationVerify($resp) ? 1 : 0 ); ( $req->datas->{crypter}->authenticationVerify($resp) ? 1 : 0 );
#$self->userLogger->notice("res=$res");
return [ return [
200, [ 'Content-Type' => 'application/json' ], 200, [ 'Content-Type' => 'application/json' ],
[qq'{"result":$res}'] [qq'{"result":$res}']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment