From 07cddf48b9318e507c635257448043e12a8f18a8 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sat, 19 May 2018 16:41:44 +0900 Subject: [PATCH] refs #317 Use forked repository for mastodon-api, and set website url when register application --- package-lock.json | 16 +++++++--------- package.json | 2 +- src/main/auth.js | 10 ++++++++-- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa074975..a8c77354 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7583,7 +7583,7 @@ "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.1.tgz", "integrity": "sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw==", "requires": { - "sparkles": "1.0.0" + "sparkles": "1.0.1" } }, "got": { @@ -7757,7 +7757,7 @@ }, "onetime": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=" }, "pluralize": { @@ -8070,7 +8070,7 @@ "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", "requires": { - "sparkles": "1.0.0" + "sparkles": "1.0.1" } }, "has-unicode": { @@ -10593,9 +10593,7 @@ } }, "mastodon-api": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/mastodon-api/-/mastodon-api-1.3.0.tgz", - "integrity": "sha1-s7z/z1HgBfdUt+huRMICPY4sY9E=", + "version": "github:h3poteto/mastodon-api#c567f019c8f1ffa19b21d73be183c9ceedac4d78", "requires": { "gulp-eslint": "3.0.1", "mime": "1.6.0", @@ -15005,9 +15003,9 @@ "dev": true }, "sparkles": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", - "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", + "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==" }, "spdx-correct": { "version": "3.0.0", diff --git a/package.json b/package.json index d9c8c2e8..19754247 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "hawk": "^7.0.7", "hoek": "^5.0.3", "is-empty": "^1.2.0", - "mastodon-api": "^1.3.0", + "mastodon-api": "github:h3poteto/mastodon-api#lib", "moment": "^2.21.0", "nedb": "^1.8.0", "object-assign-deep": "^0.4.0", diff --git a/src/main/auth.js b/src/main/auth.js index 117fa8ba..d90af3c5 100644 --- a/src/main/auth.js +++ b/src/main/auth.js @@ -1,6 +1,7 @@ import Mastodon from 'mastodon-api' const appName = 'Whalebird' +const appURL = 'https://whalebird.org' const scope = 'read write follow' export default class Authentication { @@ -22,8 +23,13 @@ export default class Authentication { async getAuthorizationUrl (domain = 'mastodon.social') { this.setOtherInstance(domain) - // Waiting for merge this pull request: https://github.com/vanita5/mastodon-api/pull/8 - const res = await Mastodon.createOAuthApp(this.baseURL + '/api/v1/apps', appName, scope) + const res = await Mastodon.createOAuthApp( + this.baseURL + '/api/v1/apps', + appName, + scope, + 'urn:ietf:wg:oauth:2.0:oob', + appURL + ) this.clientId = res.client_id this.clientSecret = res.client_secret