File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ const hasSetupData = computed<boolean>(() => qrCodeSvg.value !== null && manualS
22
22
export const useTwoFactorAuth = ( ) => {
23
23
const fetchQrCode = async ( ) : Promise < void > => {
24
24
const { svg } = await fetchJson < { svg : string ; url : string } > ( qrCode . url ( ) ) ;
25
+
25
26
qrCodeSvg . value = svg ;
26
27
} ;
27
28
28
29
const fetchSetupKey = async ( ) : Promise < void > => {
29
30
const { secretKey : key } = await fetchJson < { secretKey : string } > ( secretKey . url ( ) ) ;
31
+
30
32
manualSetupKey . value = key ;
31
33
} ;
32
34
@@ -37,6 +39,7 @@ export const useTwoFactorAuth = () => {
37
39
38
40
const clearTwoFactorAuthData = ( ) : void => {
39
41
clearSetupData ( ) ;
42
+
40
43
recoveryCodesList . value = [ ] ;
41
44
} ;
42
45
@@ -45,6 +48,7 @@ export const useTwoFactorAuth = () => {
45
48
recoveryCodesList . value = await fetchJson < string [ ] > ( recoveryCodes . url ( ) ) ;
46
49
} catch ( error ) {
47
50
console . error ( 'Failed to fetch recovery codes:' , error ) ;
51
+
48
52
recoveryCodesList . value = [ ] ;
49
53
}
50
54
} ;
@@ -54,6 +58,7 @@ export const useTwoFactorAuth = () => {
54
58
await Promise . all ( [ fetchQrCode ( ) , fetchSetupKey ( ) ] ) ;
55
59
} catch ( error ) {
56
60
console . error ( 'Failed to fetch setup data:' , error ) ;
61
+
57
62
qrCodeSvg . value = null ;
58
63
manualSetupKey . value = null ;
59
64
}
You can’t perform that action at this time.
0 commit comments