Skip to content

Commit e605988

Browse files
committed
Adding updates to the 2fa hook
1 parent 7a0da38 commit e605988

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

resources/js/hooks/use-two-factor-auth.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ interface EnableResponse {
55
secret: string;
66
}
77

8+
interface ConfirmResponse {
9+
status: string;
10+
recovery_codes?: string[];
11+
message?: string;
12+
}
13+
814
interface RecoveryCodesResponse {
915
recovery_codes: string[];
1016
}
@@ -70,7 +76,7 @@ export function useTwoFactorAuth(initialConfirmed: boolean, initialRecoveryCodes
7076
});
7177

7278
if (response.ok) {
73-
const responseData = await response.json();
79+
const responseData: ConfirmResponse = await response.json();
7480
if (responseData.recovery_codes) {
7581
setRecoveryCodesList(responseData.recovery_codes);
7682
}

0 commit comments

Comments
 (0)