fixed centering issue with radius.

Signed-off-by: boris <boris@borishub.co.uk>
This commit is contained in:
boris
2025-04-22 01:17:48 +01:00
parent 183cca3fd3
commit d027e01ccc
12 changed files with 85 additions and 215 deletions

View File

@@ -5,7 +5,7 @@
* authentication and common request patterns.
*
* The client uses JWT tokens for authentication, which are automatically
* included in requests via the fetchAuth function provided by the simpleAuth service.
* included in requests via the fetchAuth function provided by the auth service.
*
* Similar to AuthService.php, great pain and countless tears. And learning woooo!!!!!!!!
*/
@@ -14,25 +14,25 @@ class ApiClient {
* Constructor
*
* Initialises the API client and sets up the authenticated fetch function.
* Relies on the simpleAuth service being available in the global scope.
* Relies on the auth service being available in the global scope.
*/
constructor() {
// Ensure auth service is available
if (!simpleAuth) {
if (!auth) {
console.error('Auth service not available');
}
// Use the fetchAuth method from simpleAuth
// Use the fetchAuth method from auth
this.authFetch = async (url, options = {}) => {
try {
// For unauthenticated requests or when authentication is not required
if (!options.requireAuth || !simpleAuth.isAuthenticated()) {
if (!options.requireAuth || !auth.isAuthenticated()) {
return fetch(url, options);
}
// For authenticated requests
delete options.requireAuth; // Remove the custom property
return simpleAuth.fetchAuth(url, options);
return auth.fetchAuth(url, options);
} catch (error) {
console.error('Error in authFetch:', error);
throw error;