@nocobase/plugin-verification
Version:
User identity verification management, including SMS, TOTP authenticator, with extensibility.
10 lines (9 loc) • 3.15 kB
JavaScript
/**
* This file is part of the NocoBase (R) project.
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
* Authors: NocoBase Team.
*
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
;(self.webpackChunk_nocobase_plugin_verification_client_v2=self.webpackChunk_nocobase_plugin_verification_client_v2||[]).push([["81"],{560:function(e,r,t){t.r(r),t.d(r,{AdminSettingsForm:function(){return f}});var n=t(485),o=t(694),a=t(59),l=t(155),u=t.n(l),i=t(488),c=t(373);function s(e,r,t,n,o,a,l){try{var u=e[a](l),i=u.value}catch(e){t(e);return}u.done?r(i):Promise.resolve(i).then(n,o)}function f(){var e=(0,i.Au)().t,r=(0,i.kj)(),t=(0,o.useFlowContext)(),f=(0,n.useApp)().pm.get(c.A),p=a.Form.useFormInstance(),v=a.Form.useWatch(["options","provider"],p),m=(0,l.useMemo)(function(){if(!v)return null;var e,r,t=null==f||null==(r=f.smsOTPProviderManager.getProvider(v))||null==(e=r.components)?void 0:e.AdminSettingsFormLoader;return t?(0,l.lazy)(t):null},[f,v]);return u().createElement(u().Fragment,null,u().createElement(a.Form.Item,{name:["options","provider"],label:e("Provider"),rules:[{required:!0,message:e("Please select a provider")}]},u().createElement(n.RemoteSelect,{request:function(){var e;return(e=function(){var e,r,n;return function(e,r){var t,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(l,"next",{value:i(0)}),u(l,"throw",{value:i(1)}),u(l,"return",{value:i(2)}),"function"==typeof Symbol&&u(l,Symbol.iterator,{value:function(){return this}}),l;function i(u){return function(i){var c=[u,i];if(t)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(a=0)),a;)try{if(t=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=r.call(e,a)}catch(e){c=[6,e],n=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){switch(o.label){case 0:return[4,t.api.resource("smsOTPProviders").list()];case 1:return[2,Array.isArray(n=null==(r=o.sent())||null==(e=r.data)?void 0:e.data)?n:[]]}})},function(){var r=this,t=arguments;return new Promise(function(n,o){var a=e.apply(r,t);function l(e){s(a,n,o,l,u,"next",e)}function u(e){s(a,n,o,l,u,"throw",e)}l(void 0)})})()},cacheKey:"@nocobase/plugin-verification:smsOTPProviders:list",mapOptions:function(e){return{label:r(e.title||e.name),value:e.name}}})),m?u().createElement(l.Suspense,{fallback:null},u().createElement(m,null)):null)}r.default=f}}]);