Add biometric authentication registration functionality

- Implement biometric registration methods in appBridge
- Add openBiometricRegistrationPopup and closeBiometricRegistrationPopup functions
- Integrate biometric registration UI in home page and auth register component
- Fix TypeScript errors in useAppBridge hook

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jay Sheen
2025-09-15 14:09:28 +09:00
parent 9b8378ccad
commit e00dc65d7b
5 changed files with 67 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
import { useState, useEffect, useCallback } from 'react';
import { appBridge } from '@/utils/appBridge';
import { DeviceInfo, LocationInfo, ContactInfo, ShareContent } from '@/types';
import { DeviceInfo, ShareContent } from '@/types';
interface UseAppBridgeReturn {
isNativeEnvironment: boolean;
@@ -37,6 +37,14 @@ interface UseAppBridgeReturn {
*/
// 공유
shareContent: (content: ShareContent) => Promise<void>;
// 간편 인증 등록
registerBiometric: () => Promise<void>;
// 간편 인증 등록 팝업 열기
openBiometricRegistrationPopup: () => Promise<boolean>;
// 간편 인증 등록 팝업 닫기
closeBiometricRegistrationPopup: () => Promise<void>;
}
export const useAppBridge = (): UseAppBridgeReturn => {
@@ -149,6 +157,28 @@ export const useAppBridge = (): UseAppBridgeReturn => {
return appBridge.safeCall(() => appBridge.removeStorage(key));
}, [isNativeEnvironment]);
const registerBiometric = useCallback(async (): Promise<void> => {
if (!isNativeEnvironment) {
throw new Error('Biometric auth is only available in native environment');
}
return appBridge.safeCall(() => appBridge.registerBiometric());
}, [isNativeEnvironment]);
const openBiometricRegistrationPopup = useCallback(async (): Promise<boolean> => {
if (!isNativeEnvironment) {
return false;
}
const result = await appBridge.safeCall(() => appBridge.openBiometricRegistrationPopup(), false);
return result || false;
}, [isNativeEnvironment]);
const closeBiometricRegistrationPopup = useCallback(async (): Promise<void> => {
if (!isNativeEnvironment) {
return;
}
return appBridge.safeCall(() => appBridge.closeBiometricRegistrationPopup());
}, [isNativeEnvironment]);
/*
const openCamera = useCallback(async (
options?: { quality?: number; allowEdit?: boolean }
@@ -265,6 +295,9 @@ export const useAppBridge = (): UseAppBridgeReturn => {
getLocation,
getContacts,
*/
shareContent
shareContent,
registerBiometric,
openBiometricRegistrationPopup,
closeBiometricRegistrationPopup
};
};