Skip to content

Commit

Permalink
feat(types): Add support for X/Twitter v2 OAuth provider (#2690)
Browse files Browse the repository at this point in the history
  • Loading branch information
kostaspt authored Jan 31, 2024
1 parent c7ce8b4 commit 7f751c4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/smooth-numbers-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@clerk/clerk-js': minor
'@clerk/backend': minor
'@clerk/types': minor
---

Add support for X/Twitter v2 OAuth provider
3 changes: 2 additions & 1 deletion packages/backend/src/api/resources/Enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export type OAuthProvider =
| 'bitbucket'
| 'microsoft'
| 'notion'
| 'apple';
| 'apple'
| 'x';

export type OAuthStrategy = `oauth_${OAuthProvider}`;

Expand Down
1 change: 1 addition & 0 deletions packages/clerk-js/src/ui/utils/test/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ const socials = Object.freeze(
'oauth_box',
'oauth_slack',
'oauth_linear',
'oauth_x',
]),
);

Expand Down
10 changes: 9 additions & 1 deletion packages/types/src/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export type XeroOauthProvider = 'xero';
export type BoxOauthProvider = 'box';
export type SlackOauthProvider = 'slack';
export type LinearOauthProvider = 'linear';
export type XOauthProvider = 'x';

export type OAuthProvider =
| FacebookOauthProvider
Expand All @@ -60,7 +61,8 @@ export type OAuthProvider =
| XeroOauthProvider
| BoxOauthProvider
| SlackOauthProvider
| LinearOauthProvider;
| LinearOauthProvider
| XOauthProvider;

export const OAUTH_PROVIDERS: OAuthProviderData[] = [
{
Expand Down Expand Up @@ -213,6 +215,12 @@ export const OAUTH_PROVIDERS: OAuthProviderData[] = [
name: 'Linear',
docsUrl: 'https://clerk.com/docs/authentication/social-connection-with-linear',
},
{
provider: 'x',
strategy: 'oauth_x',
name: 'X / Twitter',
docsUrl: 'https://clerk.com/docs/authentication/social-connection-with-x-twitter-v2',
},
];

interface getOAuthProviderDataProps {
Expand Down

0 comments on commit 7f751c4

Please sign in to comment.