Can pick up mfa request

This commit is contained in:
2024-06-26 18:18:04 +08:00
parent ebdb6f5688
commit 38ee30f455
10 changed files with 52 additions and 12 deletions

View File

@ -1,5 +1,5 @@
<template>
<AppBar />
<app-bar />
<v-main>
<router-view />

View File

@ -1,5 +1,5 @@
<template>
<AppBar>
<app-bar>
<template #extension>
<v-tabs align-tabs="title" color="white">
<v-tab text="Dashboard" prepend-icon="mdi-view-dashboard" :to="{ name: 'dashboard' }" exact />
@ -7,7 +7,7 @@
<v-tab text="Security" prepend-icon="mdi-security" :to="{ name: 'security' }" exact />
</v-tabs>
</template>
</AppBar>
</app-bar>
<v-main>
<v-container class="pt-6 px-6 p-container">

View File

@ -39,6 +39,7 @@ const router = createRouter({
children: [
{
path: "/sign-in",
alias: ["/mfa"],
name: "auth.sign-in",
component: () => import("@/views/auth/sign-in.vue"),
meta: { public: true, title: "Sign in" },

View File

@ -25,7 +25,8 @@
</template>
<script setup lang="ts">
import { type Component, ref } from "vue"
import { type Component, onMounted, ref } from "vue"
import { useRoute } from "vue-router"
import Copyright from "@/components/Copyright.vue"
import CallbackNotify from "@/components/auth/CallbackNotify.vue"
import FactorPicker from "@/components/auth/FactorPicker.vue"
@ -33,11 +34,28 @@ import FactorApplicator from "@/components/auth/FactorApplicator.vue"
import AccountAuthenticate from "@/components/auth/Authenticate.vue"
import AuthenticateCompleted from "@/components/auth/AuthenticateCompleted.vue"
const route = useRoute()
const loading = ref(false)
const currentFactor = ref<any>(null)
const ticket = ref<any>(null)
async function pickUpTicket() {
if (route.query["ticketId"]) {
loading.value = true
const res = await fetch(`/api/auth/tickets/${route.query["ticketId"]}`)
if (res.status == 200) {
ticket.value = await res.json()
if (ticket.value["available_at"] != null) panel.value = "completed"
else panel.value = "mfa"
}
loading.value = false
}
}
onMounted(() => pickUpTicket())
const panel = ref("authenticate")
const panels: { [id: string]: Component } = {

View File

@ -1,6 +1,6 @@
<template>
<div>
<GoUseSolian class="mb-3" />
<go-use-solian class="mb-3" />
<v-card title="Information" prepend-icon="mdi-face-man-profile" :loading="loading">
<template #text>