You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(sdk,api): align SDK auth types with API and fix refresh token flow
- Replace AuthTokens with AuthResponse in SDK types — add `user` field, remove
the non-existent `expiresIn` field that the API never returns. AuthTokens is
kept as a deprecated type alias for backward compatibility.
- Fix refreshToken() to POST the refresh token in the request body instead of
relying on httpOnly cookies, which were inaccessible to the SDK in Node and
cross-origin browser contexts.
- Add POST /auth/refresh endpoint that accepts the refresh token either from the
request body (`refreshToken`) or from the `refresh_token` httpOnly cookie,
keeping the existing Next.js proxy flow working.
- Include a refresh token in login() and register() API responses so the SDK
has a token to send on refresh.
- Add findById() to UsersRepository for refresh-token user lookup.
- Add cookie-parser middleware to parse cookies for the cookie-based refresh path.
- Add comprehensive unit tests: AuthController.refresh, AuthService.refresh,
SDK client auth flows (login, register, refreshToken, 401 auto-refresh).
- Update SDK README with corrected types and refresh usage examples.
- Bump both @stellar/streaming-sdk and stellar-streaming-api to v1.1.0.
Closes#527
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
0 commit comments