Files
openhuman/app
M3gA-Mind a0da2423df fix(auth): narrow SessionExpired to confirmed OpenHuman backend 401s (#2286)
Previously, `is_session_expired_error` fired on any error containing
"401 + unauthorized", causing Discord bot-token failures, BYO-key
provider 401s, and Composio direct-mode errors to clear the user's
app session and force re-authentication.

The fix distinguishes error origins by format:
- OpenHuman backend errors (via `authed_json`) use "{METHOD} /path
  failed (401 Unauthorized): {body}" — they start with an HTTP verb.
- Provider errors ("Discord API error: ...", "OpenAI API error ...")
  start with a provider name, not an HTTP method.

Changes:
- `is_session_expired_error`: keeps explicit session markers ("session
  expired", SESSION_EXPIRED, "no backend session token", "session jwt
  required") and the HTTP-method-prefixed 401 check; removes the
  bare "invalid token" and generic "401 + unauthorized" matches.
- Adds `is_downstream_provider_auth_error` helper for diagnostic
  logging only (no side effects).
- `coreRpcClient.ts`: adds `provider_auth` error kind; tightens
  `classifyRpcError` to match backend-path 401s by HTTP-method prefix
  and route remaining 401s to `provider_auth` instead of `auth_expired`.
- Tests updated in `jsonrpc_tests.rs` and `coreRpcClient.test.ts`.

Closes #2286
2026-05-20 20:24:13 +05:30
..
2026-05-20 09:49:36 +00:00
2026-03-29 10:30:18 -07:00
2026-05-20 09:49:36 +00:00
2026-03-29 10:30:18 -07:00

Tauri + React + Typescript

This template should help get you started developing with Tauri, React and Typescript in Vite.