Skip to content

Commit 4aea6c6

Browse files
committed
Refactor two-factor authentication types to local scope
1 parent a3dbdba commit 4aea6c6

File tree

2 files changed

+9
-21
lines changed

2 files changed

+9
-21
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
import { qrCode, recoveryCodes, secretKey } from '@/routes/two-factor';
2-
import { type TwoFactorSecretKey, type TwoFactorSetupData } from '@/types';
32
import { useCallback, useMemo, useState } from 'react';
43

4+
interface TwoFactorSetupData {
5+
svg: string;
6+
url: string;
7+
}
8+
9+
interface TwoFactorSecretKey {
10+
secretKey: string;
11+
}
12+
513
export const OTP_MAX_LENGTH = 6;
614

715
const fetchJson = async <T>(url: string): Promise<T> => {

resources/js/types/index.d.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,3 @@ export interface User {
4141
updated_at: string;
4242
[key: string]: unknown; // This allows for additional properties...
4343
}
44-
45-
export interface TwoFactorSetupData {
46-
svg: string;
47-
url: string;
48-
}
49-
50-
export interface TwoFactorSecretKey {
51-
secretKey: string;
52-
}
53-
54-
export interface TwoFactorAuthenticationError {
55-
code?: string;
56-
}
57-
58-
export interface FormErrors {
59-
[key: string]: string | FormErrors | undefined;
60-
confirmTwoFactorAuthentication?: TwoFactorAuthenticationError;
61-
code?: string;
62-
recovery_code?: string;
63-
}

0 commit comments

Comments
 (0)