Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add 2fa[WTEL-3405] #666

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>

Check failure on line 1 in src/modules/directory/modules/users/components/_internals/qrcode-two-factor-auth.vue

View workflow job for this annotation

GitHub Actions / Qodana for JS

ESLint

ESLint: Install the 'eslint' package
<div class="user-qrcode">
<div class="qrcode-two-factor-auth">

<wt-popup
v-if="isConfirmationPopup"
overflow
@close="closeConfirmationPopup"
>

Expand Down Expand Up @@ -34,7 +33,7 @@

<div
ref="qrcodeContainer"
class="user-qrcode__canvas"
class="qrcode-two-factor-auth__canvas"
>
<qrcode-vue
ref="qrcode"
Expand All @@ -43,7 +42,7 @@
/>
</div>

<div class="user-qrcode__wrapper">
<div class="qrcode-two-factor-auth__wrapper">
<wt-button
color="secondary"
@click="download"
Expand Down Expand Up @@ -105,7 +104,7 @@
</script>

<style lang="scss" scoped>
.user-qrcode {
.qrcode-two-factor-auth {
display: flex;
flex-direction: column;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
@input="setItemProp({ prop: 'username', value: $event })"
/>

<user-qrcode
v-if="itemInstance.totpUrl"
<qrcode
v-if="displayQRCode"
:namespace="namespace"
:url="itemInstance.totpUrl"
/>
Expand All @@ -55,15 +55,25 @@
</template>

<script>
import { mapState } from 'vuex';
import PasswordInput from '../../../../../app/components/utils/generate-password-input.vue';
import openedTabComponentMixin
from '../../../../../app/mixins/objectPagesMixins/openedObjectTabMixin/openedTabComponentMixin';
import UserQrcode from './_internals/user-qrcode.vue';
import Qrcode from './_internals/qrcode-two-factor-auth.vue';

export default {
name: 'OpenedUserGeneral',
components: { PasswordInput, UserQrcode },
components: { PasswordInput, Qrcode },
mixins: [openedTabComponentMixin],
computed: {
...mapState('userinfo', {
permissions: (state) => state.permissions,
}),

displayQRCode() {
return this.itemInstance.totpUrl && this.permissions['change_user_password'];
Lera24 marked this conversation as resolved.
Show resolved Hide resolved
},
},
};
</script>

Expand Down
Loading