-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programfrontendgood first issueGood for newcomersGood for newcomers
Description
A configured Axios instance that automatically attaches the JWT Bearer token to every request and handles 401 errors gracefully.
Requirements
- Base URL set to
http://localhost:6003/api(configurable via env) - Request interceptor: reads token from
localStorageand addsAuthorization: Bearer <token>header - Response interceptor: on 401, attempt
POST /api/auth/refreshβ store new access token β retry original request once. If refresh fails, calluseAuthStore.getState().logout(). - Export this as the default
apiClient - Separate
authApiClient(no interceptors) for login/register/refresh calls to avoid circular refresh loops
Acceptance Criteria
- All API calls use the Axios instance (not plain
fetch) - 401 triggers one refresh attempt before logout
- Token automatically attached without manual headers per call
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programfrontendgood first issueGood for newcomersGood for newcomers