From a438f8fb9944c7d6628817d9b0bca1515b60e279 Mon Sep 17 00:00:00 2001 From: Peter Papp Date: Fri, 16 Jul 2021 18:16:11 +0200 Subject: [PATCH] added "I have already 2FA app" into recovery 2fa page --- config/language-translations.php | 1 + .../Others/TwoFactorRecoveryCodesPopup.vue | 10 +--------- resources/js/views/Auth/SignIn.vue | 18 ++++++++++++------ webpack.mix.js | 12 ++++++------ 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/config/language-translations.php b/config/language-translations.php index b85e51a8..011bcc73 100644 --- a/config/language-translations.php +++ b/config/language-translations.php @@ -685,6 +685,7 @@ return [ 'app_touch_icon_description' => 'If user store bookmark on his phone screen, this icon appear in app thumbnail. Preferred size is 156x156', 'select_search_placeholder' => 'Search in list...', '2fa.settings.title' => 'Two Factor Authentication', + '2fa.i_have_2fa_app' => 'I have already 2FA app', 'popup_2fa.title' => 'Confirm Your Password', 'popup_2fa.input_label' => 'Password', 'popup_2fa.placeholder' => 'Type your password', diff --git a/resources/js/components/Others/TwoFactorRecoveryCodesPopup.vue b/resources/js/components/Others/TwoFactorRecoveryCodesPopup.vue index c507b277..d35d8c63 100644 --- a/resources/js/components/Others/TwoFactorRecoveryCodesPopup.vue +++ b/resources/js/components/Others/TwoFactorRecoveryCodesPopup.vue @@ -85,13 +85,10 @@ export default { let copyText = this.$refs.codes copyText.select() + copyText.setSelectionRange(0, 99999) document.execCommand('copy') - copyText.setAttribute('type', 'hidden') - - window.getSelection().removeAllRanges() - events.$emit('toaster', { type: 'success', message: this.$t('popup_2fa.toaster_codes_copied'), @@ -146,11 +143,6 @@ export default { if ('two-factor-recovery-codes' === name) this.getRecoveryCodes() }) - - axios.get('/api/user/secret') - .then(response => { - console.log(response.data); - }) }, destroyed() { events.off('popup:open') diff --git a/resources/js/views/Auth/SignIn.vue b/resources/js/views/Auth/SignIn.vue index 5f875193..787b216b 100644 --- a/resources/js/views/Auth/SignIn.vue +++ b/resources/js/views/Auth/SignIn.vue @@ -122,8 +122,14 @@ -
- + + + {{ $t('2fa.i_have_2fa_app') }} + + + +
+
@@ -249,15 +255,15 @@ // End loading this.isLoading = false - // If is enabled two factor authentication + // If is enabled two factor authentication if(response.data.two_factor && ! this.validSignIn) { this.validSignIn = true this.goToAuthPage('two-factor-authentication') - } - - // If is disabled two factor authentication + } + + // If is disabled two factor authentication if(! response.data.two_factor ) { // Set login state diff --git a/webpack.mix.js b/webpack.mix.js index 7ec5d56b..71b66bb0 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -34,12 +34,12 @@ mix.js('resources/js/main.js', 'public/js') clientLogLevel: 'none' } }) - // .options({ - // hmrOptions: { - // host: '192.168.1.198', - // port: '8080' - // }, - // }) + /*.options({ + hmrOptions: { + host: '192.168.1.198', + port: '8080' + }, + })*/ .disableNotifications(); if (mix.inProduction()) {