protected $valid_minutes = 2; //The time that an OTP will be valid (in minutes)
if($otp == $q_r->value){ $success = true; $this->{'PermanentUserOtps'}->patchEntity($q_r, ['status' => 'otp_confirmed']); $this->{'PermanentUserOtps'}->save($q_r); $user_id = $q_r->permanent_user_id; $q_pu = $this->{'PermanentUsers'}->find()->where(['PermanentUsers.id' =>$user_id])->first(); if($q_pu){ $this->{'PermanentUsers'}->patchEntity($q_pu, ['active' => 1]); $this->{'PermanentUsers'}->save($q_pu); } $this->response = $this->response->withHeader('Location', "http://1.0.0.0"); return $this->response; }else{