@pubflow/react 0.4.13 → 0.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.esm.js +11 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/types/hooks/useTwoFactor.d.ts +6 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -10155,6 +10155,16 @@ function useTwoFactor(instanceId) {
|
|
|
10155
10155
|
setIsLoading(false);
|
|
10156
10156
|
}
|
|
10157
10157
|
}, [instance, refresh]);
|
|
10158
|
+
const sendCode = React.useCallback(async (methodId, method, action = 'sensitive_action') => {
|
|
10159
|
+
if (!instance)
|
|
10160
|
+
return { success: false, error: 'Pubflow not initialized' };
|
|
10161
|
+
try {
|
|
10162
|
+
return await instance.twoFactorService.start(methodId, method, action);
|
|
10163
|
+
}
|
|
10164
|
+
catch (e) {
|
|
10165
|
+
return { success: false, error: (e === null || e === void 0 ? void 0 : e.message) || 'Failed to send code' };
|
|
10166
|
+
}
|
|
10167
|
+
}, [instance]);
|
|
10158
10168
|
return {
|
|
10159
10169
|
systemEnabled,
|
|
10160
10170
|
availableMethods,
|
|
@@ -10166,6 +10176,7 @@ function useTwoFactor(instanceId) {
|
|
|
10166
10176
|
confirmSetup,
|
|
10167
10177
|
toggle,
|
|
10168
10178
|
removeMethod,
|
|
10179
|
+
sendCode,
|
|
10169
10180
|
};
|
|
10170
10181
|
}
|
|
10171
10182
|
|