Skip to content

Conversation

@MikMik1011
Copy link

@MikMik1011 MikMik1011 commented Mar 24, 2025

I've implemented methods for getting and refreshing long-lived tokens for Threads users, allowing the app to stay authenticated without requiring reauthentication every hour.

Additionally, I refactored the authorization code exchange method to use the internal _apiPost method, ensuring consistency across the codebase.

I’ve manually tested these changes, and everything works as expected with no impact on other parts of the codebase.

Copy link
Collaborator

@tonypeng tonypeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these in! Some small requests in the comments


export const GetLongLivedTokenResponseSchema = z.object({
access_token: z.string(),
"token_type": z.string(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no quotes

redirect_uri: redirectUri,
code,
}, ExchangeAuthorizationCodeResponseSchema);
return response as ExchangeAuthorizationCodeResponse;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cast not needed

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.

2 participants