API Usage refreshes

This commit is contained in:
2024-07-29 19:33:00 +02:00
parent 053724f9b7
commit e20206d4a5
4 changed files with 31 additions and 3 deletions
+3
View File
@@ -36,6 +36,9 @@ class AdminAuth implements IMiddleware
->httpCode(401)
->json(["code" => "NotAllowed", "message" => "Not Authorized"]);
}
// Keep fresh
$user->keepFresh();
} catch (Exception $err) {
// No user with this token exists
Response::response()
+4 -1
View File
@@ -26,7 +26,10 @@ class Auth implements IMiddleware
}
try {
User::getByToken($token);
$user = User::getByToken($token);
// Keep fresh
$user->keepFresh();
} catch (Exception $err) {
// No user with this token exists
Response::response()
+4 -1
View File
@@ -20,7 +20,10 @@ class OptAuth implements IMiddleware
}
try {
User::getByToken($token);
$user = User::getByToken($token);
// Keep fresh
$user->keepFresh();
} catch (Exception $err) {
// No user with this token exists
Response::response()