Skip to content

feat(frontend): add typed API interfaces and global 401 handler#785

Open
Zinai10 wants to merge 1 commit into
Web3Novalabs:mainfrom
Zinai10:feat/typed-api-interfaces-and-401-handler
Open

feat(frontend): add typed API interfaces and global 401 handler#785
Zinai10 wants to merge 1 commit into
Web3Novalabs:mainfrom
Zinai10:feat/typed-api-interfaces-and-401-handler

Conversation

@Zinai10

@Zinai10 Zinai10 commented Jun 26, 2026

Copy link
Copy Markdown
  • Add lib/api-types.ts with ApiPool, ApiDonation, ApiUser, and PaginatedResponse interfaces matching the NestJS server response shapes
  • Update lib/api-client.ts to import and re-export types from api-types.ts
  • Add global 401 handler: clears JWT, calls disconnectWallet(), redirects to /login; skips handler for /auth/challenge and /auth/verify endpoints
  • Remove duplicate ApiDonation, createPool, and fetchMyDonations declarations
  • Switch auth interceptor to Bearer token (Authorization header)

Closes #696
Closes #697

- Add lib/api-types.ts with ApiPool, ApiDonation, ApiUser, and
  PaginatedResponse<T> interfaces matching the NestJS server response shapes
- Update lib/api-client.ts to import and re-export types from api-types.ts
- Add global 401 handler: clears JWT, calls disconnectWallet(), redirects
  to /login; skips handler for /auth/challenge and /auth/verify endpoints
- Remove duplicate ApiDonation, createPool, and fetchMyDonations declarations
- Switch auth interceptor to Bearer token (Authorization header)

Closes Web3Novalabs#696, Web3Novalabs#697
@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Zinai10 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Akshola00

Copy link
Copy Markdown
Contributor

@Zinai10 rsslve conflicts

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.

[S4] Add 401 response handler to clear JWT and redirect to login [S4] Add typed API response interfaces for Pool, Donation, and User

2 participants