Skip to content

Commit

Permalink
api: Use prolinkTools protocol for finishing twitter setup
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Oct 28, 2020
1 parent 749b4f2 commit 7cfe350
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/twitter-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ type OauthData = {
secret: string;
};

/**
* Authorizes a twitter app for prolink tools twitter integration
*/
export default async (request: NowRequest, response: NowResponse) => {
var oauth = new OAuth(
'https://api.twitter.com/oauth/request_token',
Expand Down Expand Up @@ -47,5 +50,7 @@ export default async (request: NowRequest, response: NowResponse) => {
)
);

response.status(200).json(accessToken);
response.redirect(
`prolinkTools://twitter-auth?token=${accessToken.token}&secret=${accessToken.secret}`
);
};

1 comment on commit 7cfe350

@vercel
Copy link

@vercel vercel bot commented on 7cfe350 Oct 28, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.