FEAT_SAML_DOMAIN_LIST
This commit is contained in:
parent
ceac1d7352
commit
bf1234396b
@ -538,6 +538,8 @@ $routes->group("employeeRest", ['filter' => ['appSignature','AuthApiRateLimitFil
|
||||
$routes->post("verifyOtp", "RestAuthenticationController::verifyOtp");
|
||||
$routes->post("checkPassword", "RestAuthenticationController::checkPassword");
|
||||
$routes->get("downloadSampleExcel", "EmployeeRestController::downloadSampleExcel");
|
||||
$routes->get("getSamlDomainsList", "RestAuthenticationController::getSamlDomainsList");
|
||||
|
||||
// $routes->post("getPreEmployeePolicyCount", "EmployeeRestController::getPreEmployeePolicyCount");
|
||||
|
||||
});
|
||||
|
||||
@ -2134,5 +2134,32 @@ class RestAuthenticationController extends AdminController
|
||||
echo json_encode($result, JSON_UNESCAPED_SLASHES) . PHP_EOL;
|
||||
}
|
||||
|
||||
|
||||
public function getSamlDomainsList()
|
||||
{
|
||||
try {
|
||||
|
||||
$samlDomains = db_connect()
|
||||
->table('saml_client')
|
||||
->select('email_domain')
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
return $this->respond([
|
||||
'status' => 'success',
|
||||
'code' => 200,
|
||||
'data' => array_column($samlDomains, 'email_domain'),
|
||||
], 200);
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
|
||||
log_message('error', 'REST-AUTH-CONTROLLER - getSamlDomainsList error: ' . $th->getMessage());
|
||||
return $this->respond([
|
||||
'status' => 'failed',
|
||||
'code' => 500,
|
||||
'message' => 'Unable to fetch SAML domains at the moment.',
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user