Added simple TOTP Two Factor Authentication

This commit is contained in:
Ponkhy
2021-09-09 21:10:31 +02:00
parent 2583dbe0e0
commit 403202d4d4
11 changed files with 447 additions and 15 deletions

View File

@@ -120,6 +120,14 @@
</form>
</template>
<h2 class="mt-5 mb-2">
{{ $t("Two Factor Authentication") }}
</h2>
<div class="mb-3">
<button class="btn btn-primary me-2" type="button" @click="$refs.TwoFADialog.show()">{{ $t("2FA Settings") }}</button>
</div>
<h2 class="mt-5 mb-2">{{ $t("Import/Export Backup") }}</h2>
<p>
@@ -186,6 +194,7 @@
</footer>
<NotificationDialog ref="notificationDialog" />
<TwoFADialog ref="TwoFADialog" />
<Confirm ref="confirmDisableAuth" btn-style="btn-danger" :yes-text="$t('I understand, please disable')" :no-text="$t('Leave')" @yes="disableAuth">
<template v-if="$i18n.locale === 'es-ES' ">
@@ -269,6 +278,7 @@ import dayjs from "dayjs";
import utc from "dayjs/plugin/utc"
import timezone from "dayjs/plugin/timezone"
import NotificationDialog from "../components/NotificationDialog.vue";
import TwoFADialog from "../components/TwoFADialog.vue";
dayjs.extend(utc)
dayjs.extend(timezone)
@@ -279,6 +289,7 @@ const toast = useToast()
export default {
components: {
NotificationDialog,
TwoFADialog,
Confirm,
},
data() {

View File

@@ -87,7 +87,7 @@ export default {
if (res.ok) {
this.processing = true;
this.$root.login(this.username, this.password, (res) => {
this.$root.login(this.username, this.password, "", (res) => {
this.processing = false;
this.$router.push("/")
})