summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-12 15:35:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-12 15:35:06 +0000
commit012cbda407a30ab14e57ece581d720b22b47fe5a (patch)
tree62a559d2a0843d2d9700af1bb01a15cbfcee2190 /app/assets
parent92acfb1b8a9019b3fa3c817d251b2624d55da26d (diff)
downloadgitlab-ce-012cbda407a30ab14e57ece581d720b22b47fe5a.tar.gz
Add latest changes from gitlab-org/gitlab@14-3-stable-ee
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/authentication/two_factor_auth/components/manage_two_factor_form.vue7
-rw-r--r--app/assets/javascripts/authentication/two_factor_auth/index.js5
2 files changed, 11 insertions, 1 deletions
diff --git a/app/assets/javascripts/authentication/two_factor_auth/components/manage_two_factor_form.vue b/app/assets/javascripts/authentication/two_factor_auth/components/manage_two_factor_form.vue
index 280c222c380..0b748f18cb2 100644
--- a/app/assets/javascripts/authentication/two_factor_auth/components/manage_two_factor_form.vue
+++ b/app/assets/javascripts/authentication/two_factor_auth/components/manage_two_factor_form.vue
@@ -24,6 +24,7 @@ export default {
},
inject: [
'webauthnEnabled',
+ 'isCurrentPasswordRequired',
'profileTwoFactorAuthPath',
'profileTwoFactorAuthMethod',
'codesProfileTwoFactorAuthPath',
@@ -64,7 +65,11 @@ export default {
<input type="hidden" name="_method" data-testid="test-2fa-method-field" :value="method" />
<input :value="$options.csrf.token" type="hidden" name="authenticity_token" />
- <gl-form-group :label="$options.i18n.currentPassword" label-for="current-password">
+ <gl-form-group
+ v-if="isCurrentPasswordRequired"
+ :label="$options.i18n.currentPassword"
+ label-for="current-password"
+ >
<gl-form-input
id="current-password"
type="password"
diff --git a/app/assets/javascripts/authentication/two_factor_auth/index.js b/app/assets/javascripts/authentication/two_factor_auth/index.js
index f663c0705e6..7d21c19ac4c 100644
--- a/app/assets/javascripts/authentication/two_factor_auth/index.js
+++ b/app/assets/javascripts/authentication/two_factor_auth/index.js
@@ -1,4 +1,5 @@
import Vue from 'vue';
+import { parseBoolean } from '~/lib/utils/common_utils';
import { updateHistory, removeParams } from '~/lib/utils/url_utility';
import ManageTwoFactorForm from './components/manage_two_factor_form.vue';
import RecoveryCodes from './components/recovery_codes.vue';
@@ -13,16 +14,20 @@ export const initManageTwoFactorForm = () => {
const {
webauthnEnabled = false,
+ currentPasswordRequired,
profileTwoFactorAuthPath = '',
profileTwoFactorAuthMethod = '',
codesProfileTwoFactorAuthPath = '',
codesProfileTwoFactorAuthMethod = '',
} = el.dataset;
+ const isCurrentPasswordRequired = parseBoolean(currentPasswordRequired);
+
return new Vue({
el,
provide: {
webauthnEnabled,
+ isCurrentPasswordRequired,
profileTwoFactorAuthPath,
profileTwoFactorAuthMethod,
codesProfileTwoFactorAuthPath,