Skip to content

Backend: add token expiry (expiresIn/expiresAt) to /auth/verify response #82

Description

@bbjiggy

Description

Follow-up from the #79 spike (see docs/spikes/issue-79-retry-session-multisig.md).

auth/challenge.ts's verifyAndGetToken exchanges a signature for a session token via the
backend's /auth/verify endpoint, but the response currently only returns { token } — no
expiry information. The SDK's session layer (src/auth/session.ts) now supports storing an
expiresAt alongside the token and exposes isSessionExpired(), but without a backend-supplied
TTL it can only apply a conservative client-side default (currently 15 minutes), which is a guess,
not a guarantee of the token's real lifetime.

Proposal

Extend the /auth/verify response with expiresIn (seconds) or expiresAt (UNIX ms), and update
verifyAndGetToken to pass it through to saveSession.

Acceptance Criteria

  • Backend /auth/verify response includes a token expiry field
  • verifyAndGetToken in the SDK reads it and forwards it to saveSession
  • Fallback to the existing client-side default remains in place for backwards compatibility with older backend deployments

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions