Problem
Current ApiService.ets has no mechanism to attach an Authorization header:
request.request(BASE_URL + path, {
method: http.RequestMethod.GET,
connectTimeout: 15000,
readTimeout: 15000
}, ...);
This blocks JWT authentication (Issue #4) — once the backend requires tokens, the frontend cannot send them.
Proposed Solution
Add an optional token parameter to all HTTP methods:
static get(path: string, token?: string): Promise<string> {
const headers: Record<string, string> = { 'Content-Type': 'application/json' };
if (token) headers['Authorization'] = `Bearer ${token}`;
// ...
}
The token should be read from CurrentUser preferences (same storage pattern as existing user state).
References
Problem
Current
ApiService.etshas no mechanism to attach anAuthorizationheader:This blocks JWT authentication (Issue #4) — once the backend requires tokens, the frontend cannot send them.
Proposed Solution
Add an optional
tokenparameter to all HTTP methods:The token should be read from
CurrentUserpreferences (same storage pattern as existing user state).References