diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-01-21 08:42:44 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-01-21 08:42:44 +0900 |
| commit | 6f7cf99f19f93d3b32c5c772ce029274a429aee3 (patch) | |
| tree | 887f632e2fef79e252879e820574f2da616a886e /src/web | |
| parent | [Client] Improve usability (diff) | |
| download | misskey-6f7cf99f19f93d3b32c5c772ce029274a429aee3.tar.gz misskey-6f7cf99f19f93d3b32c5c772ce029274a429aee3.tar.bz2 misskey-6f7cf99f19f93d3b32c5c772ce029274a429aee3.zip | |
[Server] Fix bug
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/service/twitter/begin.ts | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/web/service/twitter/begin.ts b/src/web/service/twitter/begin.ts index c0799df5c8..2998b30c96 100644 --- a/src/web/service/twitter/begin.ts +++ b/src/web/service/twitter/begin.ts @@ -3,17 +3,19 @@ import * as express from 'express'; const Twitter = require('twitter'); import config from '../../../conf'; -const client = new Twitter({ - consumer_key: config.twitter.consumer_key, - consumer_secret: config.twitter.consumer_secret -}); - module.exports = (req: express.Request, res: express.Response) => { - client.post('oauth/request_token', { - oauth_callback: config.url + '/tw/cb' - }, (x, y, z) => { - console.log(x); - console.log(y); - console.log(z); - }); + if (config.twitter) { + const client = new Twitter({ + consumer_key: config.twitter.consumer_key, + consumer_secret: config.twitter.consumer_secret + }); + + client.post('oauth/request_token', { + oauth_callback: config.url + '/tw/cb' + }, (x, y, z) => { + console.log(x); + console.log(y); + console.log(z); + }); + } }; |