diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2018-11-17 02:13:01 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2018-11-17 02:13:01 +0900 |
| commit | db657c2a624f1907ad5165753cca81ab18280d2b (patch) | |
| tree | ceb8921c5f1e765a759f0247a31566570bd1de98 /src | |
| parent | Add missing Robot icon (used on user profiles) (#3284) (diff) | |
| download | misskey-db657c2a624f1907ad5165753cca81ab18280d2b.tar.gz misskey-db657c2a624f1907ad5165753cca81ab18280d2b.tar.bz2 misskey-db657c2a624f1907ad5165753cca81ab18280d2b.zip | |
Hide unused login method (#3285)
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/app/common/views/components/signin.vue | 14 | ||||
| -rw-r--r-- | 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 @@ </ui-input> <ui-input v-if="user && user.twoFactorEnabled" v-model="token" type="number" required styl="fill"/> <ui-button type="submit" :disabled="signing">{{ signing ? $t('signing-in') : $t('signin') }}</ui-button> - <p style="margin: 8px 0;"><a :href="`${apiUrl}/signin/twitter`">{{ $t('signin-with-twitter') }}</a></p> - <p style="margin: 8px 0;"><a :href="`${apiUrl}/signin/github`">{{ $t('signin-with-github') }}</a></p> - <p style="margin: 8px 0;"><a :href="`${apiUrl}/signin/discord`">{{ $t('signin-with-discord') /* TODO: Make these layouts better */ }}</a></p> + <p v-if="meta && meta.enableTwitterIntegration" style="margin: 8px 0;"><a :href="`${apiUrl}/signin/twitter`">{{ $t('signin-with-twitter') }}</a></p> + <p v-if="meta && meta.enableGithubIntegration" style="margin: 8px 0;"><a :href="`${apiUrl}/signin/github`">{{ $t('signin-with-github') }}</a></p> + <p v-if="meta && meta.enableDiscordIntegration" style="margin: 8px 0;"><a :href="`${apiUrl}/signin/discord`">{{ $t('signin-with-discord') /* TODO: Make these layouts better */ }}</a></p> </form> </template> @@ -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; } |