From b475795595edfcf889b3c7e0aec6c75edcf351c5 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 5 Jul 2020 01:36:02 -0400 Subject: [PATCH] feat: login bg + bypass + hide local option --- client/components/admin/admin-security.vue | 16 +++++++++++++++- client/components/login.vue | 15 +++++++++++++-- server/app/data.yml | 1 + server/controllers/auth.js | 12 +++++++++++- server/graph/resolvers/site.js | 2 ++ server/graph/schemas/site.graphql | 2 ++ server/models/authentication.js | 4 ++-- server/views/login.pug | 5 ++++- 8 files changed, 50 insertions(+), 7 deletions(-) diff --git a/client/components/admin/admin-security.vue b/client/components/admin/admin-security.vue index 17c1f9fd..c4d7fd6c 100644 --- a/client/components/admin/admin-security.vue +++ b/client/components/admin/admin-security.vue @@ -163,12 +163,21 @@ v-switch( inset :label='$t(`admin:security.bypassLogin`)' - color='red darken-2' + color='primary' v-model='config.authAutoLogin' prepend-icon='mdi-fast-forward' persistent-hint :hint='$t(`admin:security.bypassLoginHint`)' ) + v-switch( + inset + :label='$t(`admin:security.hideLocalLogin`)' + color='primary' + v-model='config.authHideLocal' + prepend-icon='mdi-eye-off-outline' + persistent-hint + :hint='$t(`admin:security.hideLocalLoginHint`)' + ) v-divider.mt-3 .overline.grey--text.pa-4 {{$t('admin:security.jwt')}} .px-4.pb-3 @@ -231,6 +240,7 @@ export default { securityCSP: false, securityCSPDirectives: '', authAutoLogin: false, + authHideLocal: false, authLoginBgUrl: '', authJwtAudience: 'urn:wiki.js', authJwtExpiration: '30m', @@ -256,6 +266,7 @@ export default { mutation: gql` mutation ( $authAutoLogin: Boolean + $authHideLocal: Boolean $authLoginBgUrl: String $authJwtAudience: String $authJwtExpiration: String @@ -275,6 +286,7 @@ export default { site { updateConfig( authAutoLogin: $authAutoLogin, + authHideLocal: $authHideLocal, authLoginBgUrl: $authLoginBgUrl, authJwtAudience: $authJwtAudience, authJwtExpiration: $authJwtExpiration, @@ -303,6 +315,7 @@ export default { `, variables: { authAutoLogin: _.get(this.config, 'authAutoLogin', false), + authHideLocal: _.get(this.config, 'authHideLocal', false), authLoginBgUrl: _.get(this.config, 'authLoginBgUrl', ''), authJwtAudience: _.get(this.config, 'authJwtAudience', ''), authJwtExpiration: _.get(this.config, 'authJwtExpiration', ''), @@ -352,6 +365,7 @@ export default { site { config { authAutoLogin + authHideLocal authLoginBgUrl authJwtAudience authJwtExpiration diff --git a/client/components/login.vue b/client/components/login.vue index 1989b4c9..7ae2d8dc 100644 --- a/client/components/login.vue +++ b/client/components/login.vue @@ -1,6 +1,6 @@