Skip to content

Enhance BlueSky integration to use token-based authentication #7

@coderabbitai

Description

@coderabbitai

Background

The current implementation in packages/studiocms_socialposter/src/routes/postToBlueSky.ts logs in for every post request to BlueSky. This approach, while functional, creates unnecessary network calls and authentication overhead.

Enhancement Proposal

Refactor the BlueSky integration to use token-based authentication (JWT) which is supported by the BlueSky API:

  • Implement a mechanism to perform a single initial login that returns access and refresh tokens
  • Store and reuse the access token for subsequent requests
  • Add logic to refresh the token when it expires
  • Use the token in request headers for authenticated operations

Benefits

  • Reduced network calls and better performance
  • Alignment with BlueSky API best practices
  • More resilient authentication flow

References

This issue was created as a TODO item based on a review comment in PR #6.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions