diff --git a/app/src/Controller/AppController.php b/app/src/Controller/AppController.php index c6778ebea..4ac062f82 100644 --- a/app/src/Controller/AppController.php +++ b/app/src/Controller/AppController.php @@ -143,7 +143,11 @@ public function beforeFilter(\Cake\Event\EventInterface $event) { $this->populateAvailableCos(); // Get Person ID - if($this->RegistryAuth->getAuthenticatedUser() !== null && $this->getCOID() !== null) { + if( + $this->RegistryAuth->isAuthenticatedUser() + && !$this->RegistryAuth->isApiUser() + && $this->getCOID() !== null + ) { $this->set('vv_person_id', $this->RegistryAuth->getPersonId($this->getCOID())); } }