mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
refactoring
This commit is contained in:
1 parent
6458e89dea
commit
3981d9551d
1 file changed
+2
-2
+2
-2
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
class AuthApi {
|
||||
public function login(){
|
||||
$token = (new ApiManager)->getToken($this->input->username,$this->input->password);
|
||||
$token = (new AuthManager)->getToken($this->input->username,$this->input->password);
|
||||
if (!$token) {
|
||||
throw new Exception("Auth failed", 401);
|
||||
}
|
||||
@@ -10,7 +10,7 @@ class AuthApi {
|
||||
|
||||
public function logout(){
|
||||
$authenticationBearrer = $_SERVER['HTTP_AUTHORIZATION'];
|
||||
if (!(new ApiManager)->deleteToken($authenticationBearrer)) {
|
||||
if (!(new AuthManager)->deleteToken($authenticationBearrer)) {
|
||||
throw new Exception("logout Failed", 401);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user