SurfSense/surfsense_web/app/dashboard
suryo12 aa86534a52 refactor(web): centralize OAuth callback cookie contract (fixes #1362)
Replace the duplicated `OAUTH_RESULT_COOKIE` constant and inline payload
type across the callback route and connector dialog hook with a shared
`contracts/types/oauth.types.ts` module that exports:

- OAUTH_RESULT_COOKIE constant
- oauthCallbackResultSchema Zod schema
- OAuthCallbackResult type (inferred from the schema)
- parseOAuthCallbackResult() helper that returns null on invalid JSON
  or shape mismatch

The route handler now uses the shared type to constrain the cookie
payload at compile time. The consumer hook validates the cookie value
through the helper instead of an unchecked JSON.parse, removing the
silent runtime risk when the cookie is tampered with or its shape
drifts.
2026-05-23 23:22:18 +07:00
..
[search_space_id] refactor(web): centralize OAuth callback cookie contract (fixes #1362) 2026-05-23 23:22:18 +07:00
error.tsx chore: ran linting 2026-05-19 21:02:07 +05:30
layout.tsx chore: linting 2026-04-07 03:10:06 -07:00
loading.tsx fix: remove message from loading UI 2026-01-27 15:28:30 +05:30
page.tsx perf: replace useSearchParams() with window.location.search in effects 2026-04-02 02:45:46 +05:30