Skip to content

feat: Axios instance with JWT Bearer token interceptors#516

Merged
yusuftomilola merged 1 commit intoDistinctCodes:mainfrom
Mkalbani:feat/axios-jwt-interceptor
Feb 25, 2026
Merged

feat: Axios instance with JWT Bearer token interceptors#516
yusuftomilola merged 1 commit intoDistinctCodes:mainfrom
Mkalbani:feat/axios-jwt-interceptor

Conversation

@Mkalbani
Copy link
Contributor

Adds a configured Axios instance with automatic JWT handling.

Changes

  • Request interceptor: auto-attaches Bearer token from localStorage
  • Response interceptor: 401 → refresh → retry once → logout
  • Separate authApiClient for login/register/refresh (no interceptors)
  • Base URL configurable via NEXT_PUBLIC_API_URL env var

Closes #446

@vercel
Copy link

vercel bot commented Feb 25, 2026

@Mkalbani is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

- Request interceptor: automatically attaches Bearer token from localStorage
- Response interceptor: handles 401 with refresh token retry, then logout
- Separate authApiClient for login/register/refresh (no interceptors)
- Base URL configurable via NEXT_PUBLIC_API_URL env var
- Updated all API modules to use new axios client
- Added root .gitignore for node_modules
@Mkalbani Mkalbani force-pushed the feat/axios-jwt-interceptor branch from 423f04f to dbe85c7 Compare February 25, 2026 13:24
@yusuftomilola yusuftomilola merged commit fff185c into DistinctCodes:main Feb 25, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontend] Create Axios API Client with JWT Refresh Interceptor

2 participants