Merge branch 'master' of gitlab.com:jankstudio/resq into 236-add-warranty-to-admin-panel

This commit is contained in:
Korina Cordero 2019-07-29 05:37:50 +00:00
commit 08247f30f6
2 changed files with 12 additions and 2 deletions

View file

@ -39,3 +39,6 @@ REDIS_CLIENT_PASSWORD=foobared
POLICY_PROMO=insertpromopolicyidhere
POLICY_THIRD_PARTY=insertthirdpartypolicyidhere
POLICY_MOBILE=insertmobilepolicyidhere
# OTP
OTP_MODE=settotestorrandom

View file

@ -239,8 +239,16 @@ class APIController extends Controller
// phone number
$phone_number = $req->request->get('phone_number');
// get otp_mode from .env
$dotenv = new Dotenv();
$dotenv->loadEnv(__DIR__.'/../../.env');
$otp_mode = $_ENV['OTP_MODE'];
// check if the phone number is our test number
if ($phone_number == '639991112233')
//if ($phone_number == '639991112233')
// check if otp_mode is test
if ($otp_mode == 'test')
{
$code = '123456';
$this->session->setConfirmCode($code)
@ -255,7 +263,6 @@ class APIController extends Controller
// TODO: validate phone number
// generate code and save
// $code = '123456';
$code = $this->generateConfirmCode();
$this->session->setConfirmCode($code)
->setPhoneNumber($phone_number);