Skip to content

feat: return expiration from getCredentials - #67

Draft
nicomiguelino wants to merge 2 commits into
mainfrom
feat/get-credentials-expiration
Draft

feat: return expiration from getCredentials#67
nicomiguelino wants to merge 2 commits into
mainfrom
feat/get-credentials-expiration

Conversation

@nicomiguelino

Copy link
Copy Markdown
Contributor

Summary

  • getCredentials() in src/utils/oauth.ts now also returns expiration from the token endpoint's JSON response (string | null | undefined), alongside token and metadata.
  • Updated JSDoc to document the new field.
  • Added src/utils/oauth.test.ts covering: token+expiration present, expiration null, expiration missing, and existing metadata behavior.

Out of scope (flagging as possible follow-ups, not implemented here):

  • initTokenRefreshLoop() is intentionally untouched — a separate PR is making it expiration-aware.
  • No response.ok error handling was added to getCredentials().

- Add expiration field to getCredentials() return type and destructure it from the token endpoint response
- Update JSDoc to document the new optional/nullable expiration field
- Add oauth.test.ts covering token+expiration, null/missing expiration, and metadata behavior
- Bump package.json/package-lock.json version from 1.3.0 to 1.4.0
- Shared with sibling PR #68 since it is unclear which of the two additive, backward-compatible changes will merge first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant