static otp for dev mode : GWM

This commit is contained in:
Gowtham M 2026-02-26 09:49:27 +05:30
parent 42a2c0c99a
commit d2b24f3a29

View File

@ -32,11 +32,21 @@ class AgentAuthController extends ResourceController
if (isset($agentData['id']))
{
$otp = random_int(100000, 999999);
if (env('CI_ENVIRONMENT') === 'development') {
$otp = 123456; // Static OTP for development
} else {
$otp = random_int(100000, 999999);
}
$update = $this->AgentModel->where('mobile', $mobile)->where('is_active', 1)->set(['email_otp' => $otp])->update();
if ($update) {
// Skip SMS in development
if (env('CI_ENVIRONMENT') === 'development') {
$result = ['agent_verification' => true, 'message' => "Verified Successfully (DEV MODE - OTP: 123456)" ];
return $this->respond(['status' => 'success','code' => 200,'data' => $result], 200);
}
$SMSResult = sendOtpSms($mobile,$otp);
@ -74,11 +84,21 @@ class AgentAuthController extends ResourceController
if (isset($agentData['id'])) {
$otp = random_int(100000, 999999);
if (env('CI_ENVIRONMENT') === 'development') {
$otp = 123456; // Static OTP for development
} else {
$otp = random_int(100000, 999999);
}
$update = $this->AgentModel->where('email', $email)->where('is_active', 1)->set(['email_otp' => $otp])->update();
if ($update) {
// Skip SMS in development
if (env('CI_ENVIRONMENT') === 'development') {
$result = ['agent_verification' => true, 'message' => "Verified Successfully (DEV MODE - OTP: 123456)" ];
return $this->respond(['status' => 'success','code' => 200,'data' => $result], 200);
}
$EmailResult = trigger_email('login_otp',['email'=>$email, 'name'=>$agentData['name'], 'otp'=>$otp, ]);