diff options
| author | Henry Jameson <me@hjkos.com> | 2019-08-31 22:38:02 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-08-31 22:38:02 +0300 |
| commit | 18ec13d796c0928d09fa93de4117822d2e35502c (patch) | |
| tree | 1cfb4d68a246c604396bb64bbba3e69bdf4fe511 /src/components/user_settings/mfa.vue | |
| parent | b3e9a5a71819c7d3a4b35c5b6ad551785a7ba44f (diff) | |
| parent | 018a650166a5dce0878b696359a999ab67634cfc (diff) | |
Merge remote-tracking branch 'upstream/develop' into docs
* upstream/develop: (193 commits)
fix user avatar fallback logic
remove dead code
make bio textarea resizable vertically only
remove dead code
remove dead code
fix crazy watch logic in conversation
show three dot button only if needed
hide mute conversation button to guests
update keyBy
generate idObj at timeline level
fix pin showing logic in conversation
Show a message when JS is disabled
Initialize chat only if user is logged in and it wasn't initialized before
i18n/Update Japanese
i18n/Update pedantic Japanese
sync profile tab state with location query
refactor TabSwitcher
use better name of controlled prop
fix potential bug to render active tab in controlled way
remove unused param
...
Diffstat (limited to 'src/components/user_settings/mfa.vue')
| -rw-r--r-- | src/components/user_settings/mfa.vue | 186 |
1 files changed, 119 insertions, 67 deletions
diff --git a/src/components/user_settings/mfa.vue b/src/components/user_settings/mfa.vue index ded426dd..14ea10a1 100644 --- a/src/components/user_settings/mfa.vue +++ b/src/components/user_settings/mfa.vue @@ -1,86 +1,138 @@ <template> -<div class="setting-item mfa-settings" v-if="readyInit"> - - <div class="mfa-heading"> - <h2>{{$t('settings.mfa.title')}}</h2> - </div> - - <div> - <div class="setting-item" v-if="!setupInProgress"> - <!-- Enabled methods --> - <h3>{{$t('settings.mfa.authentication_methods')}}</h3> - <totp-item :settings="settings" @deactivate="fetchSettings" @activate="activateOTP"/> - <br /> - - <div v-if="settings.enabled"> <!-- backup codes block--> - <recovery-codes :backup-codes="backupCodes" v-if="!confirmNewBackupCodes" /> - <button class="btn btn-default" @click="getBackupCodes" v-if="!confirmNewBackupCodes"> - {{$t('settings.mfa.generate_new_recovery_codes')}} - </button> + <div + v-if="readyInit && settings.available" + class="setting-item mfa-settings" + > + <div class="mfa-heading"> + <h2>{{ $t('settings.mfa.title') }}</h2> + </div> - <div v-if="confirmNewBackupCodes"> - <confirm @confirm="confirmBackupCodes" @cancel="cancelBackupCodes" - :disabled="backupCodes.inProgress"> - <p class="warning">{{$t('settings.mfa.warning_of_generate_new_codes')}}</p> - </confirm> + <div> + <div + v-if="!setupInProgress" + class="setting-item" + > + <!-- Enabled methods --> + <h3>{{ $t('settings.mfa.authentication_methods') }}</h3> + <totp-item + :settings="settings" + @deactivate="fetchSettings" + @activate="activateOTP" + /> + <br> + + <div v-if="settings.enabled"> + <!-- backup codes block--> + <recovery-codes + v-if="!confirmNewBackupCodes" + :backup-codes="backupCodes" + /> + <button + v-if="!confirmNewBackupCodes" + class="btn btn-default" + @click="getBackupCodes" + > + {{ $t('settings.mfa.generate_new_recovery_codes') }} + </button> + + <div v-if="confirmNewBackupCodes"> + <confirm + :disabled="backupCodes.inProgress" + @confirm="confirmBackupCodes" + @cancel="cancelBackupCodes" + > + <p class="warning"> + {{ $t('settings.mfa.warning_of_generate_new_codes') }} + </p> + </confirm> + </div> </div> </div> - </div> - - <div v-if="setupInProgress"> <!-- setup block--> - <h3>{{$t('settings.mfa.setup_otp')}}</h3> + <div v-if="setupInProgress"> + <!-- setup block--> - <recovery-codes :backup-codes="backupCodes" v-if="!setupOTPInProgress"/> + <h3>{{ $t('settings.mfa.setup_otp') }}</h3> + <recovery-codes + v-if="!setupOTPInProgress" + :backup-codes="backupCodes" + /> - <button class="btn btn-default" @click="cancelSetup" v-if="canSetupOTP"> - {{$t('general.cancel')}} - </button> - - <button class="btn btn-default" v-if="canSetupOTP" @click="setupOTP"> - {{$t('settings.mfa.setup_otp')}} - </button> - - <template v-if="setupOTPInProgress"> - <i v-if="prepareOTP">{{$t('settings.mfa.wait_pre_setup_otp')}}</i> + <button + v-if="canSetupOTP" + class="btn btn-default" + @click="cancelSetup" + > + {{ $t('general.cancel') }} + </button> - <div v-if="confirmOTP"> - <div class="setup-otp"> - <div class="qr-code"> - <h4>{{$t('settings.mfa.scan.title')}}</h4> - <p>{{$t('settings.mfa.scan.desc')}}</p> - <qrcode :value="otpSettings.provisioning_uri" :options="{ width: 200 }"></qrcode> - <p> - {{$t('settings.mfa.scan.secret_code')}}: - {{otpSettings.key}} - </p> - </div> + <button + v-if="canSetupOTP" + class="btn btn-default" + @click="setupOTP" + > + {{ $t('settings.mfa.setup_otp') }} + </button> - <div class="verify"> - <h4>{{$t('general.verify')}}</h4> - <p>{{$t('settings.mfa.verify.desc')}}</p> - <input type="text" v-model="otpConfirmToken"> + <template v-if="setupOTPInProgress"> + <i v-if="prepareOTP">{{ $t('settings.mfa.wait_pre_setup_otp') }}</i> + + <div v-if="confirmOTP"> + <div class="setup-otp"> + <div class="qr-code"> + <h4>{{ $t('settings.mfa.scan.title') }}</h4> + <p>{{ $t('settings.mfa.scan.desc') }}</p> + <qrcode + :value="otpSettings.provisioning_uri" + :options="{ width: 200 }" + /> + <p> + {{ $t('settings.mfa.scan.secret_code') }}: + {{ otpSettings.key }} + </p> + </div> - <p>{{$t('settings.enter_current_password_to_confirm')}}:</p> - <input type="password" v-model="currentPassword"> - <div class="confirm-otp-actions"> - <button class="btn btn-default" @click="doConfirmOTP"> - {{$t('settings.mfa.confirm_and_enable')}} - </button> - <button class="btn btn-default" @click="cancelSetup"> - {{$t('general.cancel')}} - </button> + <div class="verify"> + <h4>{{ $t('general.verify') }}</h4> + <p>{{ $t('settings.mfa.verify.desc') }}</p> + <input + v-model="otpConfirmToken" + type="text" + > + + <p>{{ $t('settings.enter_current_password_to_confirm') }}:</p> + <input + v-model="currentPassword" + type="password" + > + <div class="confirm-otp-actions"> + <button + class="btn btn-default" + @click="doConfirmOTP" + > + {{ $t('settings.mfa.confirm_and_enable') }} + </button> + <button + class="btn btn-default" + @click="cancelSetup" + > + {{ $t('general.cancel') }} + </button> + </div> + <div + v-if="error" + class="alert error" + > + {{ error }} + </div> </div> - <div class="alert error" v-if="error">{{error}}</div> </div> </div> - </div> - </template> + </template> + </div> </div> - </div> -</div> </template> <script src="./mfa.js"></script> |
