Skip to content

[S4] Add 401 response handler to clear JWT and redirect to login #697

Description

@Akshola00

Description

If any API call returns a 401, the stored JWT is invalid or expired. Automatically clear it and redirect the user to the login page.

Deliverables

  • API client catches 401 responses globally
  • Calls clearJwt() to remove the stored token
  • Calls walletStore.disconnectWallet() to clear wallet state
  • Redirects to /login using Next.js router.push
  • Does not redirect for 401s on the auth endpoints themselves (/auth/challenge, /auth/verify)
  • npm run build passes

Notes

Depends on #58 (interceptor) and #74 (walletStore disconnect update).

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions