2018-03-04 02:48:28 +00:00
|
|
|
<template lang='pug'>
|
|
|
|
v-card(flat)
|
|
|
|
v-card(color='grey lighten-5')
|
|
|
|
.pa-3.pt-4
|
|
|
|
.headline.primary--text Authentication
|
|
|
|
.subheading.grey--text Configure the authentication settings of your wiki
|
2018-03-12 04:09:54 +00:00
|
|
|
v-tabs(color='grey lighten-4', fixed-tabs, slider-color='primary', show-arrows)
|
2018-03-04 02:48:28 +00:00
|
|
|
v-tab(key='settings'): v-icon settings
|
2018-03-12 04:09:54 +00:00
|
|
|
v-tab(v-for='provider in activeProviders', :key='provider.key') {{ provider.title }}
|
2018-03-04 02:48:28 +00:00
|
|
|
|
2018-03-06 04:13:20 +00:00
|
|
|
v-tab-item(key='settings', :transition='false', :reverse-transition='false')
|
2018-03-04 02:48:28 +00:00
|
|
|
v-card.pa-3
|
2018-03-12 04:09:54 +00:00
|
|
|
.body-2.pb-2 Select which authentication providers to enable:
|
2018-03-04 02:48:28 +00:00
|
|
|
v-form
|
2018-03-06 04:13:20 +00:00
|
|
|
v-checkbox(
|
|
|
|
v-for='(provider, n) in providers',
|
|
|
|
v-model='auths',
|
|
|
|
:key='provider.key',
|
|
|
|
:label='provider.title',
|
|
|
|
:value='provider.key',
|
|
|
|
color='primary',
|
|
|
|
:disabled='provider.key === `local`'
|
|
|
|
hide-details
|
|
|
|
)
|
2018-03-04 02:48:28 +00:00
|
|
|
v-divider
|
|
|
|
v-btn(color='primary')
|
|
|
|
v-icon(left) chevron_right
|
|
|
|
| Set Providers
|
2018-03-05 20:49:36 +00:00
|
|
|
v-btn(color='black', dark)
|
|
|
|
v-icon(left) layers_clear
|
|
|
|
| Flush Sessions
|
2018-03-06 04:13:20 +00:00
|
|
|
v-btn(icon, @click='refresh')
|
|
|
|
v-icon.grey--text refresh
|
|
|
|
|
2018-03-12 04:09:54 +00:00
|
|
|
v-tab-item(v-for='(provider, n) in activeProviders', :key='provider.key', :transition='false', :reverse-transition='false')
|
2018-03-06 04:13:20 +00:00
|
|
|
v-card.pa-3
|
2018-03-12 04:09:54 +00:00
|
|
|
v-form
|
|
|
|
v-subheader Provider Configuration
|
|
|
|
.body-1(v-if='!provider.props || provider.props.length < 1') This provider has no configuration options you can modify.
|
|
|
|
v-text-field(v-else, v-for='prop in provider.props', :key='prop', :label='prop', prepend-icon='mode_edit')
|
|
|
|
v-divider
|
|
|
|
v-subheader Registration
|
|
|
|
v-switch.ml-3(
|
|
|
|
v-model='auths',
|
|
|
|
label='Allow self-registration',
|
|
|
|
:value='true',
|
|
|
|
color='primary',
|
|
|
|
hint='Allow any user successfully authorized by the provider to access the wiki.',
|
|
|
|
persistent-hint
|
|
|
|
)
|
|
|
|
v-text-field(label='Limit to specific email domains', prepend-icon='mail_outline')
|
|
|
|
v-text-field(label='Assign to group', prepend-icon='people')
|
2018-03-06 04:13:20 +00:00
|
|
|
v-divider
|
|
|
|
v-btn(color='primary')
|
|
|
|
v-icon(left) chevron_right
|
|
|
|
| Save Configuration
|
|
|
|
|
|
|
|
v-snackbar(
|
|
|
|
color='success'
|
|
|
|
top
|
|
|
|
v-model='refreshCompleted'
|
|
|
|
)
|
|
|
|
v-icon.mr-3(dark) cached
|
|
|
|
| List of providers has been refreshed.
|
2018-03-04 02:48:28 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-03-12 04:09:54 +00:00
|
|
|
import _ from 'lodash'
|
|
|
|
|
2018-03-06 01:53:24 +00:00
|
|
|
/* global CONSTANTS */
|
|
|
|
|
2018-03-04 02:48:28 +00:00
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
2018-03-06 01:53:24 +00:00
|
|
|
providers: [],
|
2018-03-06 04:13:20 +00:00
|
|
|
auths: ['local'],
|
|
|
|
refreshCompleted: false
|
2018-03-04 02:48:28 +00:00
|
|
|
}
|
2018-03-06 01:53:24 +00:00
|
|
|
},
|
2018-03-12 04:09:54 +00:00
|
|
|
computed: {
|
|
|
|
activeProviders() {
|
|
|
|
return _.filter(this.providers, 'isEnabled')
|
|
|
|
}
|
|
|
|
},
|
2018-03-06 01:53:24 +00:00
|
|
|
apollo: {
|
|
|
|
providers: {
|
|
|
|
query: CONSTANTS.GRAPH.AUTHENTICATION.QUERY_PROVIDERS,
|
|
|
|
update: (data) => data.authentication.providers
|
|
|
|
}
|
2018-03-06 04:13:20 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async refresh() {
|
|
|
|
await this.$apollo.queries.providers.refetch()
|
|
|
|
this.refreshCompleted = true
|
|
|
|
}
|
2018-03-04 02:48:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang='scss'>
|
|
|
|
|
|
|
|
</style>
|