You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
3.2 KiB

  1. <template lang='pug'>
  2. v-card(flat)
  3. v-card(color='grey lighten-5')
  4. .pa-3.pt-4
  5. .headline.primary--text Authentication
  6. .subheading.grey--text Configure the authentication settings of your wiki
  7. v-tabs(color='grey lighten-4', fixed-tabs, slider-color='primary', show-arrows)
  8. v-tab(key='settings'): v-icon settings
  9. v-tab(v-for='provider in activeProviders', :key='provider.key') {{ provider.title }}
  10. v-tab-item(key='settings', :transition='false', :reverse-transition='false')
  11. v-card.pa-3
  12. .body-2.pb-2 Select which authentication providers to enable:
  13. v-form
  14. v-checkbox(
  15. v-for='(provider, n) in providers',
  16. v-model='auths',
  17. :key='provider.key',
  18. :label='provider.title',
  19. :value='provider.key',
  20. color='primary',
  21. :disabled='provider.key === `local`'
  22. hide-details
  23. )
  24. v-divider
  25. v-btn(color='primary')
  26. v-icon(left) chevron_right
  27. | Set Providers
  28. v-btn(color='black', dark)
  29. v-icon(left) layers_clear
  30. | Flush Sessions
  31. v-btn(icon, @click='refresh')
  32. v-icon.grey--text refresh
  33. v-tab-item(v-for='(provider, n) in activeProviders', :key='provider.key', :transition='false', :reverse-transition='false')
  34. v-card.pa-3
  35. v-form
  36. v-subheader Provider Configuration
  37. .body-1(v-if='!provider.props || provider.props.length < 1') This provider has no configuration options you can modify.
  38. v-text-field(v-else, v-for='prop in provider.props', :key='prop', :label='prop', prepend-icon='mode_edit')
  39. v-divider
  40. v-subheader Registration
  41. v-switch.ml-3(
  42. v-model='auths',
  43. label='Allow self-registration',
  44. :value='true',
  45. color='primary',
  46. hint='Allow any user successfully authorized by the provider to access the wiki.',
  47. persistent-hint
  48. )
  49. v-text-field(label='Limit to specific email domains', prepend-icon='mail_outline')
  50. v-text-field(label='Assign to group', prepend-icon='people')
  51. v-divider
  52. v-btn(color='primary')
  53. v-icon(left) chevron_right
  54. | Save Configuration
  55. v-snackbar(
  56. color='success'
  57. top
  58. v-model='refreshCompleted'
  59. )
  60. v-icon.mr-3(dark) cached
  61. | List of providers has been refreshed.
  62. </template>
  63. <script>
  64. import _ from 'lodash'
  65. /* global CONSTANTS */
  66. export default {
  67. data() {
  68. return {
  69. providers: [],
  70. auths: ['local'],
  71. refreshCompleted: false
  72. }
  73. },
  74. computed: {
  75. activeProviders() {
  76. return _.filter(this.providers, 'isEnabled')
  77. }
  78. },
  79. apollo: {
  80. providers: {
  81. query: CONSTANTS.GRAPH.AUTHENTICATION.QUERY_PROVIDERS,
  82. update: (data) => data.authentication.providers
  83. }
  84. },
  85. methods: {
  86. async refresh() {
  87. await this.$apollo.queries.providers.refetch()
  88. this.refreshCompleted = true
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang='scss'>
  94. </style>