2018-03-04 02:48:28 +00:00
|
|
|
<template lang='pug'>
|
2018-09-30 03:30:20 +00:00
|
|
|
v-container(fluid, grid-list-lg)
|
|
|
|
v-layout(row, wrap)
|
|
|
|
v-flex(xs12)
|
|
|
|
.admin-header
|
2020-05-15 21:05:11 +00:00
|
|
|
img.animated.fadeInUp(src='/_assets/svg/icon-unlock.svg', alt='Authentication', style='width: 80px;')
|
2018-09-30 03:30:20 +00:00
|
|
|
.admin-header-title
|
2019-06-06 03:24:37 +00:00
|
|
|
.headline.primary--text.animated.fadeInLeft {{ $t('admin:auth.title') }}
|
2019-08-03 04:48:55 +00:00
|
|
|
.subtitle-1.grey--text.animated.fadeInLeft.wait-p4s {{ $t('admin:auth.subtitle') }}
|
2018-09-30 03:30:20 +00:00
|
|
|
v-spacer
|
2020-05-23 03:29:42 +00:00
|
|
|
v-btn.animated.fadeInDown.wait-p3s(icon, outlined, color='grey', href='https://docs.requarks.io/auth', target='_blank')
|
|
|
|
v-icon mdi-help-circle
|
|
|
|
v-btn.animated.fadeInDown.wait-p2s.mx-3(icon, outlined, color='grey', @click='refresh')
|
2019-08-03 04:48:55 +00:00
|
|
|
v-icon mdi-refresh
|
2019-04-07 16:37:33 +00:00
|
|
|
v-btn.animated.fadeInDown(color='success', @click='save', depressed, large)
|
2019-08-03 04:48:55 +00:00
|
|
|
v-icon(left) mdi-check
|
2019-01-01 06:40:31 +00:00
|
|
|
span {{$t('common:actions.apply')}}
|
2018-03-04 02:48:28 +00:00
|
|
|
|
2019-04-21 00:49:05 +00:00
|
|
|
v-flex(lg3, xs12)
|
|
|
|
v-card.animated.fadeInUp
|
2020-07-03 23:36:33 +00:00
|
|
|
v-toolbar(flat, color='teal', dark, dense)
|
|
|
|
.subtitle-1 {{$t('admin:auth.activeStrategies')}}
|
2019-04-21 00:49:05 +00:00
|
|
|
v-list(two-line, dense).py-0
|
2020-07-03 23:36:33 +00:00
|
|
|
draggable(
|
|
|
|
v-model='activeStrategies'
|
|
|
|
handle='.is-handle'
|
|
|
|
direction='vertical'
|
|
|
|
)
|
|
|
|
transition-group
|
|
|
|
v-list-item(
|
|
|
|
v-for='(str, idx) in activeStrategies'
|
|
|
|
:key='str.key'
|
|
|
|
@click='selectedStrategy = str.key'
|
|
|
|
:class='selectedStrategy === str.key ? ($vuetify.theme.dark ? `grey darken-5` : `teal lighten-5`) : ``'
|
|
|
|
)
|
|
|
|
v-list-item-avatar.is-handle(size='24')
|
|
|
|
v-icon(:color='selectedStrategy === str.key ? `teal` : `grey`') mdi-drag-horizontal
|
|
|
|
v-list-item-content
|
|
|
|
v-list-item-title.body-2(:class='selectedStrategy === str.key ? `teal--text` : ``') {{ str.displayName }}
|
|
|
|
v-list-item-subtitle: .caption(:class='selectedStrategy === str.key ? `teal--text ` : ``') {{ str.strategy.title }}
|
|
|
|
v-list-item-avatar(v-if='selectedStrategy === str.key', size='24')
|
|
|
|
v-icon.animated.fadeInLeft(color='teal', large) mdi-chevron-right
|
|
|
|
v-card-chin
|
|
|
|
v-menu(offset-y, bottom, min-width='250px', max-width='550px', max-height='50vh', style='flex: 1 1;', center)
|
|
|
|
template(v-slot:activator='{ on }')
|
|
|
|
v-btn(v-on='on', color='primary', depressed, block)
|
|
|
|
v-icon(left) mdi-plus
|
|
|
|
span {{$t('admin:auth.addStrategy')}}
|
|
|
|
v-list(dense)
|
|
|
|
template(v-for='(str, idx) of strategies')
|
|
|
|
v-list-item(
|
|
|
|
:key='str.key'
|
|
|
|
:disabled='str.isDisabled'
|
|
|
|
@click='addStrategy(str)'
|
|
|
|
)
|
|
|
|
v-list-item-avatar(height='24', width='48', tile)
|
|
|
|
v-img(:src='str.logo', width='48px', height='24px', contain, :style='str.isDisabled ? `opacity: .25;` : ``')
|
|
|
|
v-list-item-content
|
|
|
|
v-list-item-title {{str.title}}
|
|
|
|
v-list-item-subtitle: .caption(:style='str.isDisabled ? `opacity: .4;` : ``') {{str.description}}
|
|
|
|
v-divider(v-if='idx < strategies.length - 1')
|
2018-03-06 04:13:20 +00:00
|
|
|
|
2019-04-21 00:49:05 +00:00
|
|
|
v-flex(xs12, lg9)
|
2019-08-05 03:53:21 +00:00
|
|
|
v-card.animated.fadeInUp.wait-p2s
|
2019-04-21 00:49:05 +00:00
|
|
|
v-toolbar(color='primary', dense, flat, dark)
|
2020-07-03 23:36:33 +00:00
|
|
|
.subtitle-1 {{strategy.displayName}} #[em ({{strategy.strategy.title}})]
|
2019-09-01 22:33:36 +00:00
|
|
|
v-spacer
|
2020-07-03 23:36:33 +00:00
|
|
|
v-btn(small, outlined, dark, color='white', :disabled='strategy.key === `local`', @click='deleteStrategy()')
|
|
|
|
v-icon(left) mdi-close
|
|
|
|
span {{$t('common:actions.delete')}}
|
|
|
|
v-card-info(color='blue')
|
|
|
|
div
|
|
|
|
span {{strategy.strategy.description}}
|
|
|
|
.caption: a(:href='strategy.strategy.website') {{strategy.strategy.website}}
|
|
|
|
v-spacer
|
2020-08-22 23:37:49 +00:00
|
|
|
.admin-providerlogo
|
2020-07-03 23:36:33 +00:00
|
|
|
img(:src='strategy.strategy.logo', :alt='strategy.strategy.title')
|
2019-04-21 00:49:05 +00:00
|
|
|
v-card-text
|
2020-09-05 22:33:15 +00:00
|
|
|
.row
|
|
|
|
.col-8
|
|
|
|
v-text-field(
|
|
|
|
outlined
|
|
|
|
:label='$t(`admin:auth.displayName`)'
|
|
|
|
v-model='strategy.displayName'
|
|
|
|
prepend-icon='mdi-format-title'
|
|
|
|
:hint='$t(`admin:auth.displayNameHint`)'
|
|
|
|
persistent-hint
|
|
|
|
)
|
|
|
|
.col-4
|
|
|
|
v-switch.mt-1(
|
|
|
|
:label='$t(`admin:auth.strategyIsEnabled`)'
|
|
|
|
v-model='strategy.isEnabled'
|
|
|
|
color='primary'
|
|
|
|
prepend-icon='mdi-power'
|
|
|
|
:hint='$t(`admin:auth.strategyIsEnabledHint`)'
|
|
|
|
persistent-hint
|
|
|
|
inset
|
|
|
|
:disabled='strategy.key === `local`'
|
|
|
|
)
|
|
|
|
template(v-if='strategy.config && Object.keys(strategy.config).length > 0')
|
|
|
|
v-divider
|
|
|
|
.overline.my-5 {{$t('admin:auth.strategyConfiguration')}}
|
|
|
|
.pr-3
|
|
|
|
template(v-for='cfg in strategy.config')
|
|
|
|
v-select.mb-3(
|
|
|
|
v-if='cfg.value.type === "string" && cfg.value.enum'
|
|
|
|
outlined
|
|
|
|
:items='cfg.value.enum'
|
|
|
|
:key='cfg.key'
|
|
|
|
:label='cfg.value.title'
|
|
|
|
v-model='cfg.value.value'
|
|
|
|
prepend-icon='mdi-cog-box'
|
|
|
|
:hint='cfg.value.hint ? cfg.value.hint : ""'
|
|
|
|
persistent-hint
|
|
|
|
:class='cfg.value.hint ? "mb-2" : ""'
|
|
|
|
:style='cfg.value.maxWidth > 0 ? `max-width:` + cfg.value.maxWidth + `px;` : ``'
|
|
|
|
)
|
|
|
|
v-switch.mb-6(
|
|
|
|
v-else-if='cfg.value.type === "boolean"'
|
|
|
|
:key='cfg.key'
|
|
|
|
:label='cfg.value.title'
|
|
|
|
v-model='cfg.value.value'
|
|
|
|
color='primary'
|
|
|
|
prepend-icon='mdi-cog-box'
|
|
|
|
:hint='cfg.value.hint ? cfg.value.hint : ""'
|
|
|
|
persistent-hint
|
|
|
|
inset
|
|
|
|
)
|
|
|
|
v-textarea.mb-3(
|
|
|
|
v-else-if='cfg.value.type === "string" && cfg.value.multiline'
|
|
|
|
outlined
|
|
|
|
:key='cfg.key'
|
|
|
|
:label='cfg.value.title'
|
|
|
|
v-model='cfg.value.value'
|
|
|
|
prepend-icon='mdi-cog-box'
|
|
|
|
:hint='cfg.value.hint ? cfg.value.hint : ""'
|
|
|
|
persistent-hint
|
|
|
|
:class='cfg.value.hint ? "mb-2" : ""'
|
|
|
|
)
|
|
|
|
v-text-field.mb-3(
|
|
|
|
v-else
|
|
|
|
outlined
|
|
|
|
:key='cfg.key'
|
|
|
|
:label='cfg.value.title'
|
|
|
|
v-model='cfg.value.value'
|
|
|
|
prepend-icon='mdi-cog-box'
|
|
|
|
:hint='cfg.value.hint ? cfg.value.hint : ""'
|
|
|
|
persistent-hint
|
|
|
|
:class='cfg.value.hint ? "mb-2" : ""'
|
|
|
|
:style='cfg.value.maxWidth > 0 ? `max-width:` + cfg.value.maxWidth + `px;` : ``'
|
|
|
|
)
|
|
|
|
v-divider
|
2020-07-03 23:36:33 +00:00
|
|
|
.overline.my-5 {{$t('admin:auth.registration')}}
|
|
|
|
.pr-3
|
|
|
|
v-switch.ml-3(
|
|
|
|
v-model='strategy.selfRegistration'
|
|
|
|
:label='$t(`admin:auth.selfRegistration`)'
|
|
|
|
color='primary'
|
|
|
|
:hint='$t(`admin:auth.selfRegistrationHint`)'
|
|
|
|
persistent-hint
|
|
|
|
inset
|
|
|
|
)
|
2020-09-05 22:33:15 +00:00
|
|
|
v-combobox.ml-3.mt-5(
|
2020-07-03 23:36:33 +00:00
|
|
|
:label='$t(`admin:auth.domainsWhitelist`)'
|
|
|
|
v-model='strategy.domainWhitelist'
|
|
|
|
prepend-icon='mdi-email-check-outline'
|
|
|
|
outlined
|
|
|
|
:disabled='!strategy.selfRegistration'
|
|
|
|
:hint='$t(`admin:auth.domainsWhitelistHint`)'
|
|
|
|
persistent-hint
|
|
|
|
small-chips
|
|
|
|
deletable-chips
|
|
|
|
clearable
|
|
|
|
multiple
|
|
|
|
chips
|
2019-04-21 00:49:05 +00:00
|
|
|
)
|
2020-07-03 23:36:33 +00:00
|
|
|
v-autocomplete.mt-3.ml-3(
|
|
|
|
outlined
|
|
|
|
:disabled='!strategy.selfRegistration'
|
|
|
|
:items='groups'
|
|
|
|
item-text='name'
|
|
|
|
item-value='id'
|
|
|
|
:label='$t(`admin:auth.autoEnrollGroups`)'
|
|
|
|
v-model='strategy.autoEnrollGroups'
|
|
|
|
prepend-icon='mdi-account-group'
|
|
|
|
:hint='$t(`admin:auth.autoEnrollGroupsHint`)'
|
|
|
|
small-chips
|
|
|
|
persistent-hint
|
|
|
|
deletable-chips
|
|
|
|
clearable
|
|
|
|
multiple
|
|
|
|
chips
|
|
|
|
)
|
2019-04-21 00:49:05 +00:00
|
|
|
|
2020-04-24 04:17:10 +00:00
|
|
|
v-card.mt-4.wiki-form.animated.fadeInUp.wait-p4s(v-if='selectedStrategy !== `local`')
|
2019-04-21 00:49:05 +00:00
|
|
|
v-toolbar(color='primary', dense, flat, dark)
|
2019-08-03 04:48:55 +00:00
|
|
|
.subtitle-1 {{$t('admin:auth.configReference')}}
|
2019-04-21 00:49:05 +00:00
|
|
|
v-card-text
|
2019-08-03 04:48:55 +00:00
|
|
|
.body-2 {{$t('admin:auth.configReferenceSubtitle')}}
|
2019-08-05 03:53:21 +00:00
|
|
|
v-alert.mt-3.radius-7(v-if='host.length < 8', color='red', outlined, :value='true', icon='mdi-alert')
|
2019-06-09 01:00:12 +00:00
|
|
|
i18next(path='admin:auth.siteUrlNotSetup', tag='span')
|
|
|
|
strong(place='siteUrl') {{$t('admin:general.siteUrl')}}
|
|
|
|
strong(place='general') {{$t('admin:general.title')}}
|
2019-08-10 16:18:14 +00:00
|
|
|
.pa-3.mt-3.radius-7.grey(v-else, :class='$vuetify.theme.dark ? `darken-3-d5` : `lighten-3`')
|
2019-08-03 04:48:55 +00:00
|
|
|
.body-2: strong {{$t('admin:auth.allowedWebOrigins')}}
|
|
|
|
.body-2 {{host}}
|
2019-04-21 00:49:05 +00:00
|
|
|
v-divider.my-3
|
2019-08-03 04:48:55 +00:00
|
|
|
.body-2: strong {{$t('admin:auth.callbackUrl')}}
|
|
|
|
.body-2 {{host}}/login/{{strategy.key}}/callback
|
2019-04-21 00:49:05 +00:00
|
|
|
v-divider.my-3
|
2019-08-03 04:48:55 +00:00
|
|
|
.body-2: strong {{$t('admin:auth.loginUrl')}}
|
|
|
|
.body-2 {{host}}/login
|
2019-04-21 00:49:05 +00:00
|
|
|
v-divider.my-3
|
2019-08-03 04:48:55 +00:00
|
|
|
.body-2: strong {{$t('admin:auth.logoutUrl')}}
|
|
|
|
.body-2 {{host}}
|
2019-04-21 00:49:05 +00:00
|
|
|
v-divider.my-3
|
2019-08-03 04:48:55 +00:00
|
|
|
.body-2: strong {{$t('admin:auth.tokenEndpointAuthMethod')}}
|
|
|
|
.body-2 HTTP-POST
|
2018-03-04 02:48:28 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-03-12 04:09:54 +00:00
|
|
|
import _ from 'lodash'
|
2020-07-03 23:36:33 +00:00
|
|
|
import gql from 'graphql-tag'
|
|
|
|
import { v4 as uuid } from 'uuid'
|
2018-06-04 04:41:29 +00:00
|
|
|
|
2018-06-26 00:55:00 +00:00
|
|
|
import groupsQuery from 'gql/admin/auth/auth-query-groups.gql'
|
2019-04-21 00:49:05 +00:00
|
|
|
import hostQuery from 'gql/admin/auth/auth-query-host.gql'
|
2018-03-06 01:53:24 +00:00
|
|
|
|
2020-07-03 23:36:33 +00:00
|
|
|
import draggable from 'vuedraggable'
|
|
|
|
|
2018-03-04 02:48:28 +00:00
|
|
|
export default {
|
2020-07-03 23:36:33 +00:00
|
|
|
components: {
|
|
|
|
draggable
|
|
|
|
},
|
2018-07-01 23:50:42 +00:00
|
|
|
filters: {
|
|
|
|
startCase(val) { return _.startCase(val) }
|
|
|
|
},
|
2018-03-04 02:48:28 +00:00
|
|
|
data() {
|
|
|
|
return {
|
2018-06-26 00:55:00 +00:00
|
|
|
groups: [],
|
2018-10-13 03:14:11 +00:00
|
|
|
strategies: [],
|
2020-07-03 23:36:33 +00:00
|
|
|
activeStrategies: [],
|
2019-04-21 00:49:05 +00:00
|
|
|
selectedStrategy: '',
|
|
|
|
host: '',
|
2020-07-03 23:36:33 +00:00
|
|
|
strategy: {
|
|
|
|
strategy: {}
|
|
|
|
}
|
2018-03-04 02:48:28 +00:00
|
|
|
}
|
2018-03-06 01:53:24 +00:00
|
|
|
},
|
2019-04-21 00:49:05 +00:00
|
|
|
watch: {
|
|
|
|
selectedStrategy(newValue, oldValue) {
|
2020-07-03 23:36:33 +00:00
|
|
|
this.strategy = _.find(this.activeStrategies, ['key', newValue]) || {}
|
2019-04-21 00:49:05 +00:00
|
|
|
},
|
2020-07-03 23:36:33 +00:00
|
|
|
activeStrategies(newValue, oldValue) {
|
2019-04-21 00:49:05 +00:00
|
|
|
this.selectedStrategy = 'local'
|
|
|
|
}
|
|
|
|
},
|
2018-06-04 04:41:29 +00:00
|
|
|
methods: {
|
|
|
|
async refresh() {
|
|
|
|
await this.$apollo.queries.strategies.refetch()
|
2020-07-03 23:36:33 +00:00
|
|
|
await this.$apollo.queries.activeStrategies.refetch()
|
2018-06-04 04:41:29 +00:00
|
|
|
this.$store.commit('showNotification', {
|
2019-06-10 03:39:37 +00:00
|
|
|
message: this.$t('admin:auth.refreshSuccess'),
|
2018-06-04 04:41:29 +00:00
|
|
|
style: 'success',
|
|
|
|
icon: 'cached'
|
|
|
|
})
|
|
|
|
},
|
2020-07-03 23:36:33 +00:00
|
|
|
addStrategy (str) {
|
|
|
|
const newStr = {
|
|
|
|
key: uuid(),
|
|
|
|
strategy: str,
|
|
|
|
config: str.props.map(c => ({
|
|
|
|
key: c.key,
|
|
|
|
value: {
|
|
|
|
...c,
|
|
|
|
value: c.default
|
|
|
|
}
|
|
|
|
})),
|
|
|
|
order: this.activeStrategies.length,
|
2020-09-05 22:33:15 +00:00
|
|
|
isEnabled: true,
|
2020-07-03 23:36:33 +00:00
|
|
|
displayName: str.title,
|
|
|
|
selfRegistration: false,
|
|
|
|
domainWhitelist: [],
|
|
|
|
autoEnrollGroups: []
|
|
|
|
}
|
|
|
|
this.activeStrategies = [...this.activeStrategies, newStr]
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.selectedStrategy = newStr.key
|
|
|
|
})
|
|
|
|
},
|
|
|
|
deleteStrategy () {
|
|
|
|
this.activeStrategies = _.reject(this.activeStrategies, ['key', this.strategy.key])
|
|
|
|
},
|
2018-06-26 00:55:00 +00:00
|
|
|
async save() {
|
2018-06-04 04:41:29 +00:00
|
|
|
this.$store.commit(`loadingStart`, 'admin-auth-savestrategies')
|
2019-01-13 03:33:30 +00:00
|
|
|
try {
|
2020-07-03 23:36:33 +00:00
|
|
|
const resp = await this.$apollo.mutate({
|
|
|
|
mutation: gql`
|
|
|
|
mutation($strategies: [AuthenticationStrategyInput]!) {
|
|
|
|
authentication {
|
|
|
|
updateStrategies(strategies: $strategies) {
|
|
|
|
responseResult {
|
|
|
|
succeeded
|
|
|
|
errorCode
|
|
|
|
slug
|
|
|
|
message
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`,
|
2019-01-13 03:33:30 +00:00
|
|
|
variables: {
|
2020-09-07 19:04:02 +00:00
|
|
|
strategies: this.activeStrategies.map((str, idx) => ({
|
2020-07-03 23:36:33 +00:00
|
|
|
key: str.key,
|
|
|
|
strategyKey: str.strategy.key,
|
|
|
|
displayName: str.displayName,
|
2020-09-07 19:04:02 +00:00
|
|
|
order: idx,
|
2020-09-05 22:33:15 +00:00
|
|
|
isEnabled: str.isEnabled,
|
2020-07-03 23:36:33 +00:00
|
|
|
config: str.config.map(cfg => ({...cfg, value: JSON.stringify({ v: cfg.value.value })})),
|
|
|
|
selfRegistration: str.selfRegistration,
|
|
|
|
domainWhitelist: str.domainWhitelist,
|
|
|
|
autoEnrollGroups: str.autoEnrollGroups
|
|
|
|
}))
|
2019-01-13 03:33:30 +00:00
|
|
|
}
|
|
|
|
})
|
2020-07-03 23:36:33 +00:00
|
|
|
if (_.get(resp, 'data.authentication.updateStrategies.responseResult.succeeded', false)) {
|
|
|
|
this.$store.commit('showNotification', {
|
|
|
|
message: this.$t('admin:auth.saveSuccess'),
|
|
|
|
style: 'success',
|
|
|
|
icon: 'check'
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
throw new Error(_.get(resp, 'data.authentication.updateStrategies.responseResult.message', this.$t('common:error.unexpected')))
|
|
|
|
}
|
2019-01-13 03:33:30 +00:00
|
|
|
} catch (err) {
|
|
|
|
this.$store.commit('pushGraphError', err)
|
|
|
|
}
|
2018-06-04 04:41:29 +00:00
|
|
|
this.$store.commit(`loadingStop`, 'admin-auth-savestrategies')
|
2018-03-06 01:53:24 +00:00
|
|
|
}
|
2018-03-06 04:13:20 +00:00
|
|
|
},
|
2018-06-04 04:41:29 +00:00
|
|
|
apollo: {
|
|
|
|
strategies: {
|
2020-07-03 23:36:33 +00:00
|
|
|
query: gql`
|
|
|
|
query {
|
|
|
|
authentication {
|
|
|
|
strategies {
|
|
|
|
key
|
|
|
|
title
|
|
|
|
description
|
|
|
|
isAvailable
|
|
|
|
useForm
|
|
|
|
logo
|
|
|
|
website
|
|
|
|
props {
|
|
|
|
key
|
|
|
|
value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`,
|
|
|
|
fetchPolicy: 'network-only',
|
|
|
|
update: (data) => _.get(data, 'authentication.strategies', []).map(str => ({
|
|
|
|
...str,
|
|
|
|
isDisabled: !str.isAvailable || str.key === `local`,
|
|
|
|
props: _.sortBy(str.props.map(cfg => ({
|
|
|
|
key: cfg.key,
|
|
|
|
...JSON.parse(cfg.value)
|
|
|
|
})), [t => t.order])
|
|
|
|
})),
|
|
|
|
watchLoading (isLoading) {
|
|
|
|
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-auth-strategies-refresh')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
activeStrategies: {
|
|
|
|
query: gql`
|
|
|
|
query {
|
|
|
|
authentication {
|
|
|
|
activeStrategies {
|
|
|
|
key
|
|
|
|
strategy {
|
|
|
|
key
|
|
|
|
title
|
|
|
|
description
|
|
|
|
useForm
|
|
|
|
logo
|
|
|
|
website
|
|
|
|
}
|
|
|
|
config {
|
|
|
|
key
|
|
|
|
value
|
|
|
|
}
|
|
|
|
order
|
2020-09-05 22:33:15 +00:00
|
|
|
isEnabled
|
2020-07-03 23:36:33 +00:00
|
|
|
displayName
|
|
|
|
selfRegistration
|
|
|
|
domainWhitelist
|
|
|
|
autoEnrollGroups
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`,
|
2018-06-04 04:41:29 +00:00
|
|
|
fetchPolicy: 'network-only',
|
2020-09-07 19:04:02 +00:00
|
|
|
update: (data) => _.sortBy(_.get(data, 'authentication.activeStrategies', []).map(str => ({
|
2019-04-21 00:49:05 +00:00
|
|
|
...str,
|
|
|
|
config: _.sortBy(str.config.map(cfg => ({
|
|
|
|
...cfg,
|
|
|
|
value: JSON.parse(cfg.value)
|
|
|
|
})), [t => t.value.order])
|
2020-09-07 19:04:02 +00:00
|
|
|
})), ['order']),
|
2018-06-04 04:41:29 +00:00
|
|
|
watchLoading (isLoading) {
|
2020-07-03 23:36:33 +00:00
|
|
|
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-auth-activestrategies-refresh')
|
2018-06-04 04:41:29 +00:00
|
|
|
}
|
2018-06-26 00:55:00 +00:00
|
|
|
},
|
|
|
|
groups: {
|
|
|
|
query: groupsQuery,
|
|
|
|
fetchPolicy: 'network-only',
|
|
|
|
update: (data) => data.groups.list,
|
|
|
|
watchLoading (isLoading) {
|
|
|
|
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-auth-groups-refresh')
|
|
|
|
}
|
2019-04-21 00:49:05 +00:00
|
|
|
},
|
|
|
|
host: {
|
|
|
|
query: hostQuery,
|
|
|
|
fetchPolicy: 'network-only',
|
|
|
|
update: (data) => _.cloneDeep(data.site.config.host),
|
|
|
|
watchLoading (isLoading) {
|
|
|
|
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-auth-host-refresh')
|
|
|
|
}
|
2018-03-06 04:13:20 +00:00
|
|
|
}
|
2018-03-04 02:48:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|