FEAT_DEFAULT_OTP_BIFITS_AND_HR_LOGIN
This commit is contained in:
parent
4f4bbfb7b4
commit
7f7754f6aa
11
.env.sample
11
.env.sample
@ -184,4 +184,13 @@ CORS_DEBUG=true
|
||||
|
||||
APP_SIGNATURE =
|
||||
TOKENTIMEOUT =
|
||||
JWT_SECRET =
|
||||
JWT_SECRET =
|
||||
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# OTP Configuration
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
DEFAULT_OTP = ''
|
||||
IS_SEND_EMAIL_OTP =
|
||||
IS_SEND_SMS_OTP =
|
||||
@ -158,10 +158,17 @@ class RestAuthenticationController extends AdminController
|
||||
}
|
||||
|
||||
$otp = random_int(100000, 999999);
|
||||
if($mobile_number == '9442741776')
|
||||
{
|
||||
$default_otp = env('DEFAULT_OTP');
|
||||
$is_send_sms_otp = env('IS_SEND_SMS_OTP');
|
||||
|
||||
if(!empty($default_otp)){
|
||||
$otp = $default_otp;
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Sending default otp");
|
||||
}
|
||||
|
||||
if($mobile_number == '9442741776') {
|
||||
$otp = '123456';
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: setting 123456 for IOS APP TESTING = " . json_encode($employeeData));
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: setting 123456 for IOS APP TESTING = " . json_encode($employeeData));
|
||||
}
|
||||
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Final employee data to verify = " . json_encode($employeeData));
|
||||
@ -211,13 +218,13 @@ class RestAuthenticationController extends AdminController
|
||||
}
|
||||
|
||||
//skip sms for live test no
|
||||
if($mobile_number == '9442741776')
|
||||
{
|
||||
|
||||
if($mobile_number == '9442741776' || $is_send_sms_otp == false) {
|
||||
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: skip SMS sent for IOS APP TESTING = " . ($mobile_number));
|
||||
$result = ['user_verification' => true ,'message' => "Verified Successfully" ];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
$result = ['user_verification' => true ,'message' => "Verified Successfully" ];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result, 'is_sms_send' => false],200);
|
||||
}
|
||||
|
||||
//send sms
|
||||
$SMSResult = sendOtpSms($mobile_number, $otp);
|
||||
if ($SMSResult['status'] == 'success')
|
||||
@ -276,6 +283,14 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
$otp = random_int(100000, 999999);
|
||||
|
||||
$default_otp = env('DEFAULT_OTP');
|
||||
$is_send_email_otp = env('IS_SEND_EMAIL_OTP');
|
||||
|
||||
if(!empty($default_otp)){
|
||||
$otp = $default_otp;
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Sending default otp");
|
||||
}
|
||||
|
||||
//only retail policy
|
||||
if(empty($empdata)){
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithEmailId: No employee data found both PRE & POST");
|
||||
@ -387,6 +402,11 @@ class RestAuthenticationController extends AdminController
|
||||
'mail_type' => 'otp_mail',
|
||||
];
|
||||
|
||||
if($is_send_email_otp == false){
|
||||
$result = ['user_verification' => true, 'message' => "Verified Successfully"];
|
||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $result, 'is_email_send' => false], 200);
|
||||
}
|
||||
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithEmailId: Sending OTP email to " . $employeeData['email_corporate']);
|
||||
$res = $this->sendEmailOtp($employeeData['email_corporate'], $otp, $common);
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithEmailId: Mail response = " . $res);
|
||||
@ -596,6 +616,13 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
$otp = random_int(100000, 999999);
|
||||
|
||||
$default_otp = env('DEFAULT_OTP');
|
||||
$is_send_sms_otp = env('IS_SEND_SMS_OTP');
|
||||
|
||||
if(!empty($default_otp)){
|
||||
$otp = $default_otp;
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Sending default otp");
|
||||
}
|
||||
|
||||
if ($HrData)
|
||||
{
|
||||
@ -617,6 +644,11 @@ class RestAuthenticationController extends AdminController
|
||||
$data->otp = $otp;
|
||||
$this->callThirdPartyAPI($data, 'updateHROTP');
|
||||
|
||||
if($is_send_sms_otp == false){
|
||||
$result = ['user_verification' => true, 'message' => "Verified Successfully"];
|
||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $result, 'is_sms_send' => false], 200);
|
||||
}
|
||||
|
||||
//send sms
|
||||
$SMSResult = sendOtpSms($mobile_number, $otp);
|
||||
if ($SMSResult['status'] == 'success')
|
||||
@ -661,7 +693,14 @@ class RestAuthenticationController extends AdminController
|
||||
->first();
|
||||
|
||||
$otp = random_int(100000, 999999);
|
||||
$data->otp = $otp;
|
||||
|
||||
$default_otp = env('DEFAULT_OTP');
|
||||
$is_send_email_otp = env('IS_SEND_EMAIL_OTP');
|
||||
|
||||
if(!empty($default_otp)){
|
||||
$otp = $default_otp;
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Sending default otp");
|
||||
}
|
||||
|
||||
if ($HrData) {
|
||||
|
||||
@ -685,10 +724,16 @@ class RestAuthenticationController extends AdminController
|
||||
$update = $db->query($sql, [$otp, $email]);
|
||||
|
||||
if($update)
|
||||
{
|
||||
{
|
||||
|
||||
$data->otp = $otp;
|
||||
$this->callThirdPartyAPI($data, 'updateHROTP');
|
||||
|
||||
if($is_send_email_otp == false){
|
||||
$result = ['user_verification' => true, 'message' => "Verified Successfully"];
|
||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $result, 'is_email_send' => false], 200);
|
||||
}
|
||||
|
||||
$common = [
|
||||
'login_type' => 'HR login',
|
||||
'login_email' => $email,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user