Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Jan 31, 2025
1 parent b0ed4af commit 67e3096
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 28 deletions.
10 changes: 3 additions & 7 deletions src/agents/shared/auth/linkedin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,9 @@ async function getArcadeLinkedInAuthOrInterrupt(
const scopes = fields?.postToOrg
? ["w_member_social", "w_organization_social"]
: ["w_member_social"];
const authResponse = await arcade.auth.start(
linkedInUserId,
"linkedin",
{
scopes,
}
)
const authResponse = await arcade.auth.start(linkedInUserId, "linkedin", {
scopes,
});
const authUrl = authResponse.url;

if (authUrl) {
Expand Down
20 changes: 6 additions & 14 deletions src/clients/linkedin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,9 @@ export class LinkedInClient {
},
): Promise<AuthorizeUserResponse> {
const scopes = LinkedInClient.getScopes(fields?.postToOrganization);
const authRes = await client.auth.start(
id,
"linkedin",
{
scopes,
}
)
const authRes = await client.auth.start(id, "linkedin", {
scopes,
});

if (authRes.status === "completed") {
if (!authRes.context?.token) {
Expand Down Expand Up @@ -322,13 +318,9 @@ export class LinkedInClient {
apiKey: process.env.ARCADE_API_KEY,
});
const scopes = LinkedInClient.getScopes(fields?.postToOrganization);
const authRes = await arcade.auth.start(
linkedInUserId,
"linkedin",
{
scopes,
}
)
const authRes = await arcade.auth.start(linkedInUserId, "linkedin", {
scopes,
});

if (!authRes.context?.token || !authRes.context?.user_info?.sub) {
throw new Error(
Expand Down
10 changes: 3 additions & 7 deletions src/clients/twitter/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,9 @@ export class TwitterClient {
id: string,
client: Arcade,
): Promise<AuthorizeUserResponse> {
const authRes = await client.auth.start(
id,
"x",
{
scopes: ["tweet.write", "users.read", "tweet.read", "offline.access"],
}
);
const authRes = await client.auth.start(id, "x", {
scopes: ["tweet.write", "users.read", "tweet.read", "offline.access"],
});

if (authRes.status === "completed") {
if (!authRes.context?.token) {
Expand Down

0 comments on commit 67e3096

Please sign in to comment.