static otp for dev mode : GWM

This commit is contained in:
Gowtham M 2026-02-26 09:29:46 +05:30
parent b1112924b6
commit 42a2c0c99a

View File

@ -35,11 +35,21 @@ class StaffAuthController extends ResourceController
if (isset($StaffData['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->StaffModel->where('mobile', $mobile)->where('is_active', 1)->set(['email_otp' => $otp])->update();
if ($update) {
// Skip SMS in development
if (env('CI_ENVIRONMENT') === 'development') {
$result = ['Staff_verification' => true, 'message' => "Verified Successfully (DEV MODE - OTP: 123456)" ];
return $this->respond(['status' => 'success','code' => 200,'data' => $result], 200);
}
$SMSResult = sendOtpSms($mobile,$otp);
@ -77,11 +87,21 @@ class StaffAuthController extends ResourceController
if (isset($StaffData['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->StaffModel->where('email', $email)->where('is_active', 1)->set(['email_otp' => $otp])->update();
if ($update) {
// Skip SMS in development
if (env('CI_ENVIRONMENT') === 'development') {
$result = ['Staff_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'=>$StaffData['name'], 'otp'=>$otp, ]);