未利用時はTwitterでログインを表示しない (#2156)

This commit is contained in:
MeiMei 2018-08-11 20:20:35 +09:00 committed by syuilo
parent a8f142096c
commit 9bc17974f2
3 changed files with 8 additions and 4 deletions

View file

@ -12,13 +12,13 @@
</ui-input>
<ui-input v-if="user && user.twoFactorEnabled" v-model="token" type="number" required/>
<ui-button type="submit" :disabled="signing">{{ signing ? '%i18n:@signing-in%' : '%i18n:@signin%' }}</ui-button>
<p style="margin: 8px 0;">%i18n:@or%<a :href="`${apiUrl}/signin/twitter`">%i18n:@signin-with-twitter%</a></p>
<p style="margin: 8px 0;" v-if="twitterIntegration">%i18n:@or%<a :href="`${apiUrl}/signin/twitter`">%i18n:@signin-with-twitter%</a></p>
</form>
</template>
<script lang="ts">
import Vue from 'vue';
import { apiUrl, host } from '../../../config';
import { apiUrl, host, twitterIntegration } from '../../../config';
export default Vue.extend({
props: {
@ -36,7 +36,8 @@ export default Vue.extend({
password: '',
token: '',
apiUrl,
host
host,
twitterIntegration
};
},
methods: {

View file

@ -22,6 +22,7 @@ declare const _CODENAME_: string;
declare const _LICENSE_: string;
declare const _GOOGLE_MAPS_API_KEY_: string;
declare const _WELCOME_BG_URL_: string;
declare const _TWITTER_INTEGRATION_: boolean;
export const host = _HOST_;
export const hostname = _HOSTNAME_;
@ -47,3 +48,4 @@ export const codename = _CODENAME_;
export const license = _LICENSE_;
export const googleMapsApiKey = _GOOGLE_MAPS_API_KEY_;
export const welcomeBgUrl = _WELCOME_BG_URL_;
export const twitterIntegration = _TWITTER_INTEGRATION_;

View file

@ -95,7 +95,8 @@ const consts = {
_URL_: config.url,
_LICENSE_: licenseHtml,
_GOOGLE_MAPS_API_KEY_: config.google_maps_api_key,
_WELCOME_BG_URL_: config.welcome_bg_url
_WELCOME_BG_URL_: config.welcome_bg_url,
_TWITTER_INTEGRATION_: config.twitter != null
};
const _consts: { [ key: string ]: any } = {};