requestToken appBridge
This commit is contained in:
@@ -38,6 +38,12 @@ interface UseAppBridgeReturn {
|
||||
// 공유
|
||||
shareContent: (content: ShareContent) => Promise<void>;
|
||||
|
||||
// 로그아웃
|
||||
logout: () => Promise<void>;
|
||||
|
||||
// 토큰 요청
|
||||
requestToken: () => Promise<any>;
|
||||
|
||||
// 간편 인증 등록
|
||||
registerBiometric: () => Promise<void>;
|
||||
|
||||
@@ -157,6 +163,20 @@ export const useAppBridge = (): UseAppBridgeReturn => {
|
||||
return appBridge.safeCall(() => appBridge.removeStorage(key));
|
||||
}, [isNativeEnvironment]);
|
||||
|
||||
const logout = useCallback(async (): Promise<void> => {
|
||||
if (!isNativeEnvironment) {
|
||||
throw new Error('Logout is only available in native environment');
|
||||
}
|
||||
return appBridge.safeCall(() => appBridge.logout());
|
||||
}, [isNativeEnvironment]);
|
||||
|
||||
const requestToken = useCallback(async (): Promise<any> => {
|
||||
if (!isNativeEnvironment) {
|
||||
throw new Error('Token request is only available in native environment');
|
||||
}
|
||||
return appBridge.safeCall(() => appBridge.requestToken());
|
||||
}, [isNativeEnvironment]);
|
||||
|
||||
const registerBiometric = useCallback(async (): Promise<void> => {
|
||||
if (!isNativeEnvironment) {
|
||||
throw new Error('Biometric auth is only available in native environment');
|
||||
@@ -296,6 +316,8 @@ export const useAppBridge = (): UseAppBridgeReturn => {
|
||||
getContacts,
|
||||
*/
|
||||
shareContent,
|
||||
logout,
|
||||
requestToken,
|
||||
registerBiometric,
|
||||
openBiometricRegistrationPopup,
|
||||
closeBiometricRegistrationPopup
|
||||
|
||||
Reference in New Issue
Block a user