From db657c2a624f1907ad5165753cca81ab18280d2b Mon Sep 17 00:00:00 2001
From: MeiMei <30769358+mei23@users.noreply.github.com>
Date: Sat, 17 Nov 2018 02:13:01 +0900
Subject: [PATCH] Hide unused login method (#3285)
---
src/client/app/common/views/components/signin.vue | 14 ++++++++++----
src/server/api/endpoints/meta.ts | 7 ++++---
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/src/client/app/common/views/components/signin.vue b/src/client/app/common/views/components/signin.vue
index 6ea7f652d6..c1a7522b00 100644
--- a/src/client/app/common/views/components/signin.vue
+++ b/src/client/app/common/views/components/signin.vue
@@ -12,9 +12,9 @@
{{ $t('signin-with-twitter') }}
-{{ $t('signin-with-github') }}
-{{ $t('signin-with-discord') /* TODO: Make these layouts better */ }}
+{{ $t('signin-with-twitter') }}
+{{ $t('signin-with-github') }}
+{{ $t('signin-with-discord') /* TODO: Make these layouts better */ }}
@@ -41,9 +41,15 @@ export default Vue.extend({ password: '', token: '', apiUrl, - host: toUnicode(host) + host: toUnicode(host), + meta: null }; }, + created() { + this.$root.getMeta().then(meta => { + this.meta = meta; + }); + }, methods: { onUsernameChange() { this.$root.api('users/show', { diff --git a/src/server/api/endpoints/meta.ts b/src/server/api/endpoints/meta.ts index 56386cc1f5..9846e95959 100644 --- a/src/server/api/endpoints/meta.ts +++ b/src/server/api/endpoints/meta.ts @@ -68,6 +68,10 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => { maxNoteTextLength: instance.maxNoteTextLength, emojis: emojis, + + enableTwitterIntegration: instance.enableTwitterIntegration, + enableGithubIntegration: instance.enableGithubIntegration, + enableDiscordIntegration: instance.enableDiscordIntegration, }; if (ps.detail) { @@ -89,13 +93,10 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => { response.hidedTags = instance.hidedTags; response.recaptchaSecretKey = instance.recaptchaSecretKey; response.proxyAccount = instance.proxyAccount; - response.enableTwitterIntegration = instance.enableTwitterIntegration; response.twitterConsumerKey = instance.twitterConsumerKey; response.twitterConsumerSecret = instance.twitterConsumerSecret; - response.enableGithubIntegration = instance.enableGithubIntegration; response.githubClientId = instance.githubClientId; response.githubClientSecret = instance.githubClientSecret; - response.enableDiscordIntegration = instance.enableDiscordIntegration; response.discordClientId = instance.discordClientId; response.discordClientSecret = instance.discordClientSecret; }