Merge branch 'master' of gitlab.com:jankstudio/resq into 236-add-warranty-to-admin-panel
This commit is contained in:
commit
08247f30f6
2 changed files with 12 additions and 2 deletions
|
|
@ -39,3 +39,6 @@ REDIS_CLIENT_PASSWORD=foobared
|
||||||
POLICY_PROMO=insertpromopolicyidhere
|
POLICY_PROMO=insertpromopolicyidhere
|
||||||
POLICY_THIRD_PARTY=insertthirdpartypolicyidhere
|
POLICY_THIRD_PARTY=insertthirdpartypolicyidhere
|
||||||
POLICY_MOBILE=insertmobilepolicyidhere
|
POLICY_MOBILE=insertmobilepolicyidhere
|
||||||
|
|
||||||
|
# OTP
|
||||||
|
OTP_MODE=settotestorrandom
|
||||||
|
|
|
||||||
|
|
@ -239,8 +239,16 @@ class APIController extends Controller
|
||||||
// phone number
|
// phone number
|
||||||
$phone_number = $req->request->get('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
|
// 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';
|
$code = '123456';
|
||||||
$this->session->setConfirmCode($code)
|
$this->session->setConfirmCode($code)
|
||||||
|
|
@ -255,7 +263,6 @@ class APIController extends Controller
|
||||||
// TODO: validate phone number
|
// TODO: validate phone number
|
||||||
|
|
||||||
// generate code and save
|
// generate code and save
|
||||||
// $code = '123456';
|
|
||||||
$code = $this->generateConfirmCode();
|
$code = $this->generateConfirmCode();
|
||||||
$this->session->setConfirmCode($code)
|
$this->session->setConfirmCode($code)
|
||||||
->setPhoneNumber($phone_number);
|
->setPhoneNumber($phone_number);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue