Skip to content

Commit

Permalink
fix: fixed minor bug about mfa (#4894)
Browse files Browse the repository at this point in the history
Signed-off-by: NaYeong,Kim <[email protected]>
  • Loading branch information
skdud4659 authored Oct 23, 2024
1 parent bc79d26 commit 91f0cb4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/services/auth/pages/MultiFactorAuthPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const handleClickResend = async () => {
await loadAuth().signIn(state.credentials, 'MFA');
validationState.verificationCode = '';
} catch (e: any) {
if (e.message.includes('MFA')) {
if (e.message.includes('MFA') || e.message.includes('Authenticate')) {
showSuccessMessage(_i18n.t('COMMON.MFA_MODAL.SUCCESS'), '');
} else {
showErrorMessage(e.message, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ const handleClickVerifyButton = async () => {
<template #data-mfa="{data}">
<p>
<span>{{ data?.state === 'ENABLED' ? 'On' : 'Off' }}</span>
<span> - {{ data?.mfa_type === MULTI_FACTOR_AUTH_TYPE.EMAIL ? `Email (${data.options.email})` : 'Microsoft Authenticator App' }}</span>
<span v-if="data?.state === 'ENABLED'"> - {{ data?.mfa_type === MULTI_FACTOR_AUTH_TYPE.EMAIL ? `Email (${data.options.email})` : 'Microsoft Authenticator App' }}</span>
</p>
</template>
<template #data-role_id="{value, data}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ watch(() => multiFactorAuthState.modalType, () => {
</div>
<user-account-multi-factor-auth-modal-folding v-if="storeState.selectedType === MULTI_FACTOR_AUTH_TYPE.EMAIL"
:is-disabled-modal="storeState.isDisabledModal"
:is-re-sync-modal="storeState.isReSyncModal"
:is-sent-code.sync="state.isSentCode"
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ import { useProxyValue } from '@/common/composables/proxy-state';
interface Props {
isDisabledModal: boolean
isReSyncModal: boolean
isSentCode: boolean
}
const props = withDefaults(defineProps<Props>(), {
isDisabledModal: false,
isReSyncModal: false,
isSentCode: false,
});
Expand All @@ -31,7 +33,7 @@ const state = reactive({
});
const handleClickSendEmailButton = async () => {
if (props.isDisabledModal) {
if (props.isDisabledModal || props.isReSyncModal) {
await postUserProfileDisableMfa();
} else {
await postEnableMfa({
Expand All @@ -58,7 +60,7 @@ const handleClickSendEmailButton = async () => {
{{ $t('COMMON.MFA_MODAL.COLLAPSE_DESC') }}
<p-text-button class="send-code-button"
style-type="highlight"
:disabled="props.isDisabledModal ? !storeState.email : !props.isSentCode"
:disabled="(props.isDisabledModal || props.isReSyncModal) ? !storeState.email : !props.isSentCode"
@click.prevent="handleClickSendEmailButton"
>
<span class="emphasis">{{ $t('COMMON.MFA_MODAL.SEND_NEW_CODE') }}</span>
Expand Down

0 comments on commit 91f0cb4

Please sign in to comment.