Welcome Guest, Not a member yet? Register   Sign In
$this->request->getVar('account_id') NULL for no reason

Hi All,
I have created filter to check JWT token and then I am adding values to request, so that I can use in Controller. It is absolutely working fine on 5 routes, but somehow getVar is giving null value for another function in controller.

public function verifyAccountCode()
        $account_id = $this->request->getVar('account_id');
        $is_active = $this->request->getVar('is_active');
        $verification_code = $this->request->getVar('verification_code');

        return $this->respond(['acc' => $account_id], 200);


$model = new AccountsModel();
$user = $model->select(['account_id','username','email','is_active','timezone'])->where('account_id', $decoded['account_id'])->first();           
$request->setGlobal('request', $user);

$routes->post('/resend-verification-code', 'AccountVerification::sendVerificationCode', ['filter' => 'auth_acc_inactive']);
$routes->post('/verify-account', 'Accounts::verifyAccountCode', ['filter' => 'auth_acc_inactive']);

It is absolutely working fine for /resend-verification-code, but somehow giving NULL value for /verify-account. Code is same in both the functions.

Any idea guys? I checked on Google and there was thread that there been bug in i think 4.0.4 codeigniter version. But I am using the latest on with php8.1

Any clue guys?

Messages In This Thread
$this->request->getVar('account_id') NULL for no reason - by encodedigital - 10-19-2022, 10:02 AM

Theme © iAndrew 2016 - Forum software by © MyBB