|
|
@ -744,8 +744,12 @@ sub login_jwt :Chained('/') :PathPart('login_jwt') :Args(0) :Method('POST') {
|
|
|
|
$c->log->info("User not found");
|
|
|
|
$c->log->info("User not found");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($auth_user->enable_2fa
|
|
|
|
if ($auth_user->enable_2fa) {
|
|
|
|
and not NGCP::Panel::Utils::Auth::verify_otp($c,$auth_user->otp_secret,$otp,time())) {
|
|
|
|
if (NGCP::Panel::Utils::Auth::verify_otp($c,$auth_user->otp_secret,$otp,time())) {
|
|
|
|
|
|
|
|
$auth_user->update({
|
|
|
|
|
|
|
|
show_otp_registration_info => 0,
|
|
|
|
|
|
|
|
}) if ($auth_user->show_otp_registration_info);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
$c->response->status(HTTP_FORBIDDEN);
|
|
|
|
$c->response->status(HTTP_FORBIDDEN);
|
|
|
|
$c->response->body(encode_json({
|
|
|
|
$c->response->body(encode_json({
|
|
|
|
code => HTTP_FORBIDDEN,
|
|
|
|
code => HTTP_FORBIDDEN,
|
|
|
@ -754,6 +758,7 @@ sub login_jwt :Chained('/') :PathPart('login_jwt') :Args(0) :Method('POST') {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
my $authrs = $c->model('DB')->resultset('provisioning_voip_subscribers')->search({
|
|
|
|
my $authrs = $c->model('DB')->resultset('provisioning_voip_subscribers')->search({
|
|
|
|
webusername => $u,
|
|
|
|
webusername => $u,
|
|
|
|