Api exeption handler

This commit is contained in:
xinatorus
2020-04-25 11:38:06 +02:00
parent 8300e47b76
commit 119149bf5e
2 changed files with 11 additions and 8 deletions

View File

@@ -23,10 +23,10 @@ class ApiController {
$authManager = new AuthManager();
$this->authenticated = $authManager>validateToken($this->headers['HTTP_AUTHORIZATION']);
if(!$this->authenticated){
throw new Exception("Auth required", 401);
throw new Exception("Authorization required", 401);
}
} else {
throw new Exception("Auth required", 401);
throw new Exception("Authorization required", 401);
}
}