Skip to content

Commit d7b058e

Browse files
authored
Update useTwoFactorAuth.ts
1 parent 6b327f2 commit d7b058e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

resources/js/composables/useTwoFactorAuth.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ const hasSetupData = computed<boolean>(() => qrCodeSvg.value !== null && manualS
2222
export const useTwoFactorAuth = () => {
2323
const fetchQrCode = async (): Promise<void> => {
2424
const { svg } = await fetchJson<{ svg: string; url: string }>(qrCode.url());
25+
2526
qrCodeSvg.value = svg;
2627
};
2728

2829
const fetchSetupKey = async (): Promise<void> => {
2930
const { secretKey: key } = await fetchJson<{ secretKey: string }>(secretKey.url());
31+
3032
manualSetupKey.value = key;
3133
};
3234

@@ -37,6 +39,7 @@ export const useTwoFactorAuth = () => {
3739

3840
const clearTwoFactorAuthData = (): void => {
3941
clearSetupData();
42+
4043
recoveryCodesList.value = [];
4144
};
4245

@@ -45,6 +48,7 @@ export const useTwoFactorAuth = () => {
4548
recoveryCodesList.value = await fetchJson<string[]>(recoveryCodes.url());
4649
} catch (error) {
4750
console.error('Failed to fetch recovery codes:', error);
51+
4852
recoveryCodesList.value = [];
4953
}
5054
};
@@ -54,6 +58,7 @@ export const useTwoFactorAuth = () => {
5458
await Promise.all([fetchQrCode(), fetchSetupKey()]);
5559
} catch (error) {
5660
console.error('Failed to fetch setup data:', error);
61+
5762
qrCodeSvg.value = null;
5863
manualSetupKey.value = null;
5964
}

0 commit comments

Comments
 (0)