Avoid optional Fortify route imports
linter / quality (pull_request) Successful in 1m22s
tests / ci (8.4) (pull_request) Successful in 1m35s

This commit is contained in:
2026-05-22 23:33:01 +00:00
parent fd0d6ac6d6
commit 94e32497b0
14 changed files with 76 additions and 32 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
import type { ComputedRef, Ref } from 'vue';
import { computed, ref } from 'vue';
import { qrCode, recoveryCodes, secretKey } from '@/routes/two-factor';
import { fortifyRoutes } from '@/lib/fortify';
export type UseTwoFactorAuthReturn = {
qrCodeSvg: Ref<string | null>;
@@ -42,7 +42,7 @@ export const useTwoFactorAuth = (): UseTwoFactorAuthReturn => {
const fetchQrCode = async (): Promise<void> => {
try {
const { svg } = await fetchJson<{ svg: string; url: string }>(
qrCode.url(),
fortifyRoutes.twoFactor.qrCode,
);
qrCodeSvg.value = svg;
@@ -55,7 +55,7 @@ export const useTwoFactorAuth = (): UseTwoFactorAuthReturn => {
const fetchSetupKey = async (): Promise<void> => {
try {
const { secretKey: key } = await fetchJson<{ secretKey: string }>(
secretKey.url(),
fortifyRoutes.twoFactor.secretKey,
);
manualSetupKey.value = key;
@@ -85,7 +85,7 @@ export const useTwoFactorAuth = (): UseTwoFactorAuthReturn => {
try {
clearErrors();
recoveryCodesList.value = await fetchJson<string[]>(
recoveryCodes.url(),
fortifyRoutes.twoFactor.recoveryCodes,
);
} catch {
errors.value.push('Failed to fetch recovery codes');