Browse Source

set auth function to return 401 if organizr is not setup or an error has occurred

CauseFX 4 years ago
parent
commit
5481e5e2db
1 changed files with 4 additions and 1 deletions
  1. 4 1
      api/classes/organizr.class.php

+ 4 - 1
api/classes/organizr.class.php

@@ -601,8 +601,11 @@ class Organizr
 				$this->setAPIResponse('error', 'Missing info', 401);
 				$this->setAPIResponse('error', 'Missing info', 401);
 				$this->logger->debug('Missing info', $userInfo);
 				$this->logger->debug('Missing info', $userInfo);
 			}
 			}
+			return true;
+		} else {
+			$this->setAPIResponse('error', 'Organizr is not setup or an error occurred', 401);
+			return false;
 		}
 		}
-		return true;
 	}
 	}
 	
 	
 	public function getIpInfo($ip = null)
 	public function getIpInfo($ip = null)