@nocobase/plugin-auth 1.6.0-alpha.20 → 1.6.0-alpha.22
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/client/88ef1c520c08b674.js +10 -0
- package/dist/client/index.js +1 -1
- package/dist/client/interceptors.d.ts +1 -1
- package/dist/externalVersion.js +9 -9
- package/dist/locale/en-US.json +2 -2
- package/dist/locale/zh-CN.json +3 -3
- package/dist/node_modules/cron/package.json +1 -1
- package/dist/node_modules/ms/package.json +1 -1
- package/package.json +2 -2
- package/dist/client/dfc184578d2220ec.js +0 -10
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
(self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).push([["104"],{349:function(e,t,n){"use strict";n.r(t),n.d(t,{TokenPolicySettings:function(){return I}});var r,o=n("156"),i=n.n(o),a=n("772"),s=n("721"),u=n("875"),c=n("584"),l=n("573"),f=n("505"),m=n("563"),p=n("83"),d=n.n(p),h="token-policy-config",y="tokenControlConfig";function b(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){n(e);return}s.done?t(u):Promise.resolve(u).then(r,o)}function v(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){b(i,r,o,a,s,"next",e)}function s(e){b(i,r,o,a,s,"throw",e)}a(void 0)})}}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var k="useSubmitActionProps",x="useEditForm",O=(g(r={},x,function(){var e=(0,a.useAPIClient)(),t=(0,o.useMemo)(function(){return(0,m.createForm)()},[]);return(0,o.useEffect)(function(){var n;(n=v(function(){var n,r;return w(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e.resource(y).get({filterByTk:h})];case 1:return(null==(r=o.sent().data)?void 0:null===(n=r.data)||void 0===n?void 0:n.config)&&t.setValues(r.data.config),[3,3];case 2:return console.error(o.sent()),[3,3];case 3:return[2]}})}),function(){return n.apply(this,arguments)})()},[t,e]),{form:t}}),g(r,k,function(){var e=s.App.useApp().message,t=(0,a.useAPIClient)(),n=(0,f.useForm)(),r=(0,l.o$)().t;return{type:"primary",onClick:function(){return v(function(){var o,i,a,s,u;return w(this,function(s){switch(s.label){case 0:if(n.clearErrors("*"),i=(o=n.values).tokenExpirationTime,a=o.sessionExpirationTime,o.expiredTokenRenewLimit,d()(i)>=d()(a))return n.setFieldState("tokenExpirationTime",function(e){e.feedbacks=[{type:"error",code:"ValidateError",messages:[r("Token validity period must be less than session validity period!")]}]}),[2];return[4,n.submit()];case 1:return s.sent(),[4,t.resource(y).update({values:{config:n.values},filterByTk:h})];case 2:return(u=s.sent())&&200===u.status&&e.success(r("Saved successfully!")),[2]}})})()}}}),r);function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T=s.Select.Option,j=(0,f.connect)(function(e){var t,n,r=(0,l.o$)().t,a=e.value,u=e.onChange,c=e.minNum,f=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["value","onChange","minNum"]),m=a?a.match(/^(\d*)([a-zA-Z]*)$/):null;(0,o.useEffect)(function(){!m&&u("10m")},[m,u]);var p=(t=m?[parseInt(m[1]),m[2]]:[10,"m"],n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(s)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=p[0],h=p[1],y=i().createElement(s.Select,{value:h,onChange:function(e){return u("".concat(d).concat(e))},style:{width:120}},i().createElement(T,{value:"m"},r("Minutes")),i().createElement(T,{value:"h"},r("Hours")),i().createElement(T,{value:"d"},r("Days")));return i().createElement(s.InputNumber,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){S(e,t,n[t])})}return e}({value:d,addonAfter:y,min:void 0===c?1:c,onChange:function(e){return u("".concat(null!=e?e:1).concat(h))}},f))},(0,f.mapProps)({onInput:"onChange"})),A="InputTime",P=S({},A,j),C={name:(0,u.uid)(),"x-component":"FormV2","x-use-component-props":x,type:"object",properties:{sessionExpirationTime:{type:"string",title:"{{t('Session validity period')}}","x-decorator":"FormItem","x-component":A,required:!0,description:(0,c.tval)("The maximum valid time for each user login. During the session validity, the Token will be automatically updated. After the timeout, the user is required to log in again.")},tokenExpirationTime:{type:"string",title:"{{t('Token validity period')}}","x-decorator":"FormItem","x-component":A,required:!0,description:(0,c.tval)("The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)")},expiredTokenRenewLimit:{type:"string",title:"{{t('Expired token refresh limit')}}","x-decorator":"FormItem","x-component":A,"x-component-props":{minNum:0},required:!0,description:(0,c.tval)("The maximum time limit allowed for refreshing a Token after it expires. After this time limit, the token cannot be automatically renewed, and the user needs to log in again.")},footer:{type:"void","x-component":"ActionBar","x-component-props":{layout:"one-column"},properties:{submit:{title:'{{t("Submit")}}',"x-component":"Action","x-use-component-props":k}}}}},I=function(){var e=(0,l.o$)().t;return i().createElement(s.Card,{bordered:!1},i().createElement(a.SchemaComponent,{schema:C,scope:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({t:e},O),components:P}))}},83:function(e){var t=6e4,n=36e5,r=864e5,o=6048e5,i=315576e5;e.exports=function(e,s){s=s||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!!a){var s=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*i;case"weeks":case"week":case"w":return s*o;case"days":case"day":case"d":return s*r;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*t;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}(e);if("number"===u&&isFinite(e))return s.long?function(e){var o=Math.abs(e);return o>=r?a(e,o,r,"day"):o>=n?a(e,o,n,"hour"):o>=t?a(e,o,t,"minute"):o>=1e3?a(e,o,1e3,"second"):e+" ms"}(e):function(e){var o=Math.abs(e);return o>=r?Math.round(e/r)+"d":o>=n?Math.round(e/n)+"h":o>=t?Math.round(e/t)+"m":o>=1e3?Math.round(e/1e3)+"s":e+"ms"}(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function a(e,t,n,r){return Math.round(e/n)+" "+r+(t>=1.5*n?"s":"")}}}]);
|
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react"),require("@formily/antd-v5"),require("react"),require("react-i18next"),require("@nocobase/utils/client"),require("@formily/shared"),require("@formily/core"),require("@emotion/css"),require("antd"),require("react-router-dom")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth",["@nocobase/client","@ant-design/icons","@formily/react","@formily/antd-v5","react","react-i18next","@nocobase/utils/client","@formily/shared","@formily/core","@emotion/css","antd","react-router-dom"],e):"object"==typeof exports?exports["@nocobase/plugin-auth"]=e(require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react"),require("@formily/antd-v5"),require("react"),require("react-i18next"),require("@nocobase/utils/client"),require("@formily/shared"),require("@formily/core"),require("@emotion/css"),require("antd"),require("react-router-dom")):t["@nocobase/plugin-auth"]=e(t["@nocobase/client"],t["@ant-design/icons"],t["@formily/react"],t["@formily/antd-v5"],t.react,t["react-i18next"],t["@nocobase/utils/client"],t["@formily/shared"],t["@formily/core"],t["@emotion/css"],t.antd,t["react-router-dom"])}(self,function(t,e,n,r,o,i,u,c,a,f,s,l){return function(){var p,d,y,h,b,v,m={851:function(t,e,n){"use strict";n.r(e),n.d(e,{AuthLayout:function(){return E},useSignIn:function(){return L},PluginAuthClient:function(){return I},AuthenticatorsContextProvider:function(){return C},default:function(){return M},AuthenticatorsContext:function(){return f.H},useAuthenticator:function(){return f.u}});var r=n("772"),o=n("584"),i=n("741"),u=n.n(i),c=u()(function(t){t()},3e3,{leading:!0,trailing:!1}),a=n("573"),f=n("308"),s=n(581);function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function p(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){n(t);return}c.done?e(a):Promise.resolve(a).then(r,o)}function d(t,e,n){return(d=m()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&b(o,n.prototype),o}).apply(null,arguments)}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function v(t){var e="function"==typeof Map?new Map:void 0;return(v=function(t){var n;if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return d(t,arguments,h(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),b(r,t)})(t)}function m(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(m=function(){return!!t})()}var g=(0,r.lazy)(function(){return s("imported_gs6osn_component",n.e("890").then(n.bind(n,387)))},"AuthProvider").AuthProvider,x=(0,r.lazy)(function(){return s("imported_kl5khg_component",n.e("938").then(n.bind(n,510)))},"Options","SignInForm","SignUpForm"),_=x.Options,S=x.SignInForm,w=x.SignUpForm,j=(0,r.lazy)(function(){return s("imported_-1ja1ffa_component",n.e("280").then(n.bind(n,492)))},"AuthLayout","SignInPage","SignUpPage"),A=j.AuthLayout,O=j.SignInPage,k=j.SignUpPage,P=(0,r.lazy)(function(){return s("imported_10vpsc8_component",n.e("851").then(n.bind(n,264)))},"Authenticator").Authenticator,T=(0,r.lazy)(function(){return s("imported_-1q5gcq5_component",n.e("104").then(n.bind(n,349)))},"TokenPolicySettings").TokenPolicySettings,q=(0,r.lazy)(function(){return s("imported_-1ja1ffa_component",n.e("280").then(n.bind(n,492)))},"AuthenticatorsContextProvider","AuthLayout"),C=q.AuthenticatorsContextProvider,E=q.AuthLayout,I=function(t){var e,n,r;function i(){var t,e,n,r,u,c,a;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,i),e=this,n=i,r=arguments,n=h(n),u=t=function(t,e){return e&&("object"===function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}(e)||"function"==typeof e)?e:function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(e,m()?Reflect.construct(n,r||[],h(e).constructor):n.apply(e,r)),c="authTypes",a=new o.Registry,c in u?Object.defineProperty(u,c,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[c]=a,t}return!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e)}(i,t),e=i,n=[{key:"registerType",value:function(t,e){this.authTypes.register(t,e)}},{key:"load",value:function(){var t,e=this;return(t=function(){var t,n,r;return function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,function(o){var i,u,f;return e.app.pluginSettingsManager.add(a.A7,{icon:"LoginOutlined",title:'{{t("Authentication", { ns: "'.concat(a.A7,'" })}}'),Component:P,aclSnippet:"pm.auth.authenticators"}),e.router.add("auth",{Component:"AuthLayout"}),e.router.add("auth.signin",{path:"/signin",Component:"SignInPage"}),e.router.add("auth.signup",{path:"/signup",Component:"SignUpPage"}),e.app.addComponents({AuthLayout:A,SignInPage:O,SignUpPage:k}),e.app.providers.unshift([g,{}]),e.registerType("Email/Password",{components:{SignInForm:S,SignUpForm:w,AdminSettingsForm:_}}),e.app.pluginSettingsManager.add("security.token-policy",{title:'{{t("Token policy", { ns: "'.concat(a.A7,'" })}}'),Component:T,aclSnippet:"pm.security.token-policy",icon:"ApiOutlined",sort:0}),u=((i=({app:e.app}).app).apiClient.axios,[function(t){var e=t.headers["x-new-token"];return e&&i.apiClient.auth.setToken(e),t},function(t){var e=t.response.headers["x-new-token"];if(e&&i.apiClient.auth.setToken(e),401===t.status&&!(null===(n=t.config)||void 0===n?void 0:n.skipAuth)){var n,r,o,u=null==t?void 0:null===(o=t.response)||void 0===o?void 0:null===(r=o.data)||void 0===r?void 0:r.errors,a=Array.isArray(u)?u[0]:null;if(!a)throw t;if((null==a?void 0:a.code)==="USER_HAS_NO_ROLES_ERR")throw i.error=a,t;var f=i.router.state.location,s=f.pathname,l=f.search,p=i.router.basename;if(s!==i.getHref("signin")){var d,y,h,b=(d=s,y=p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),h=new RegExp("^".concat(y.replace(/\/?$/,""),"(\\/|$)")),d.replace(h,"/")||d);c(function(){i.apiClient.auth.setToken(null),i.router.navigate("/signin?redirect=".concat(b).concat(l),{replace:!0})})}}throw t}]),f=2,n=(t=function(t){if(Array.isArray(t))return t}(u)||function(t,e){var n,r,o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i=[],u=!0,c=!1;try{for(o=o.call(t);!(u=(n=o.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){c=!0,r=t}finally{try{!u&&null!=o.return&&o.return()}finally{if(c)throw r}}return i}}(u,2)||function(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}}(u,f)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],r=t[1],e.app.apiClient.axios.interceptors.response.use(n,r),[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){p(i,r,o,u,c,"next",t)}function c(t){p(i,r,o,u,c,"throw",t)}u(void 0)})})()}}],y(e.prototype,n),i}(v(r.Plugin)),L=function(t){return(0,r.useLazy)(function(){return s("imported_kl5khg_component",n.e("938").then(n.bind(n,510)))},"useSignIn")(t)},M=I},308:function(t,e,n){"use strict";n.d(e,{H:function(){return o},u:function(){return i}});var r=n(156),o=(0,r.createContext)([]);o.displayName="AuthenticatorsContext";var i=function(t){return(0,r.useContext)(o).find(function(e){return e.name===t})}},573:function(t,e,n){"use strict";n.d(e,{A7:function(){return i},KQ:function(){return c},o$:function(){return u}});var r=n(238),o=n(772),i="auth";function u(){return(0,r.useTranslation)([i,"client"],{nsMode:"fallback"})}function c(t){return o.i18n.t(t,{ns:[i,"client"],nsMode:"fallback"})}},869:function(t,e,n){var r=n(31).Symbol;t.exports=r},365:function(t,e,n){var r=n(869),o=n(43),i=n(283),u=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?o(t):i(t)}},527:function(t,e,n){var r=n(670),o=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(o,""):t}},274:function(t,e,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},43:function(t,e,n){var r=n(869),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,c=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,c),n=t[c];try{t[c]=void 0;var r=!0}catch(t){}var o=u.call(t);return r&&(e?t[c]=n:delete t[c]),o}},283:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},31:function(t,e,n){var r=n(274),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},670:function(t){var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},741:function(t,e,n){var r=n(917),o=n(860),i=n(640),u=Math.max,c=Math.min;t.exports=function(t,e,n){var a,f,s,l,p,d,y=0,h=!1,b=!1,v=!0;if("function"!=typeof t)throw TypeError("Expected a function");function m(e){var n=a,r=f;return a=f=void 0,y=e,l=t.apply(r,n)}e=i(e)||0,r(n)&&(h=!!n.leading,s=(b="maxWait"in n)?u(i(n.maxWait)||0,e):s,v="trailing"in n?!!n.trailing:v);function g(t){var n=t-d,r=t-y;return void 0===d||n>=e||n<0||b&&r>=s}function x(){var t,n,r,i,u=o();if(g(u))return _(u);p=setTimeout(x,(n=(t=u)-d,r=t-y,i=e-n,b?c(i,s-r):i))}function _(t){return(p=void 0,v&&a)?m(t):(a=f=void 0,l)}function S(){var t,n=o(),r=g(n);if(a=arguments,f=this,d=n,r){if(void 0===p){;return y=t=d,p=setTimeout(x,e),h?m(t):l}if(b)return clearTimeout(p),p=setTimeout(x,e),m(d)}return void 0===p&&(p=setTimeout(x,e)),l}return S.cancel=function(){void 0!==p&&clearTimeout(p),y=0,a=d=f=p=void 0},S.flush=function(){return void 0===p?l:_(o())},S}},917:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},620:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},528:function(t,e,n){var r=n(365),o=n(620);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},860:function(t,e,n){var r=n(31);t.exports=function(){return r.Date.now()}},640:function(t,e,n){var r=n(527),o=n(917),i=n(528),u=0/0,c=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,f=/^0o[0-7]+$/i,s=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return u;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=a.test(t);return n||f.test(t)?s(t.slice(2),n?2:8):c.test(t)?u:+t}},581:function(t){t.exports=function(t,e){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(t,e),e}},482:function(t){"use strict";t.exports=e},964:function(t){"use strict";t.exports=f},632:function(t){"use strict";t.exports=r},563:function(t){"use strict";t.exports=a},505:function(t){"use strict";t.exports=n},875:function(t){"use strict";t.exports=c},772:function(e){"use strict";e.exports=t},584:function(t){"use strict";t.exports=u},721:function(t){"use strict";t.exports=s},156:function(t){"use strict";t.exports=o},238:function(t){"use strict";t.exports=i},128:function(t){"use strict";t.exports=l}},g={};function x(t){var e=g[t];if(void 0!==e)return e.exports;var n=g[t]={exports:{}};return m[t](n,n.exports,x),n.exports}return x.m=m,x.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return x.d(e,{a:e}),e},x.d=function(t,e){for(var n in e)x.o(e,n)&&!x.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},x.f={},x.e=function(t){return Promise.all(Object.keys(x.f).reduce(function(e,n){return x.f[n](t,e),e},[]))},x.u=function(t){return""+({104:"dfc184578d2220ec",280:"9e603524b127e7b4",851:"974ac9de644a1d1f",890:"43e9587ca4936ffe",938:"0091d4359312cb07"})[t]+".js"},x.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),x.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},p={},d="@nocobase/plugin-auth:",x.l=function(t,e,n,r){if(p[t]){p[t].push(e);return}if(void 0!==n){for(var o,i,u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var a=u[c];if(a.getAttribute("src")==t||a.getAttribute("data-webpack")==d+n){o=a;break}}}!o&&(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,x.nc&&o.setAttribute("nonce",x.nc),o.setAttribute("data-webpack",d+n),o.src=t),p[t]=[e];var f=function(e,n){o.onerror=o.onload=null,clearTimeout(s);var r=p[t];if(delete p[t],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(t){return t(n)}),e)return e(n)},s=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),i&&document.head.appendChild(o)},x.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},x.p=(!(y=window.__nocobase_public_path__||"/").endsWith("/")&&(y+="/"),y+"static/plugins/@nocobase/plugin-auth/dist/client/"),h={909:0},x.f.j=function(t,e){var n=x.o(h,t)?h[t]:void 0;if(0!==n){if(n)e.push(n[2]);else{var r=new Promise(function(e,r){n=h[t]=[e,r]});e.push(n[2]=r);var o=x.p+x.u(t),i=Error();x.l(o,function(e){if(x.o(h,t)&&(0!==(n=h[t])&&(h[t]=void 0),n)){var r=e&&("load"===e.type?"missing":e.type),o=e&&e.target&&e.target.src;i.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+t,t)}}},b=function(t,e){var n=e[0],r=e[1],o=e[2],i,u,c=0;if(n.some(function(t){return 0!==h[t]})){for(i in r)x.o(r,i)&&(x.m[i]=r[i]);o&&o(x)}for(t&&t(e);c<n.length;c++)u=n[c],x.o(h,u)&&h[u]&&h[u][0](),h[u]=0},(v=self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).forEach(b.bind(null,0)),v.push=b.bind(null,v.push.bind(v)),x("851")}()});
|
|
10
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react"),require("@formily/antd-v5"),require("react"),require("react-i18next"),require("@nocobase/utils/client"),require("@formily/shared"),require("@formily/core"),require("@emotion/css"),require("antd"),require("react-router-dom")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth",["@nocobase/client","@ant-design/icons","@formily/react","@formily/antd-v5","react","react-i18next","@nocobase/utils/client","@formily/shared","@formily/core","@emotion/css","antd","react-router-dom"],e):"object"==typeof exports?exports["@nocobase/plugin-auth"]=e(require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react"),require("@formily/antd-v5"),require("react"),require("react-i18next"),require("@nocobase/utils/client"),require("@formily/shared"),require("@formily/core"),require("@emotion/css"),require("antd"),require("react-router-dom")):t["@nocobase/plugin-auth"]=e(t["@nocobase/client"],t["@ant-design/icons"],t["@formily/react"],t["@formily/antd-v5"],t.react,t["react-i18next"],t["@nocobase/utils/client"],t["@formily/shared"],t["@formily/core"],t["@emotion/css"],t.antd,t["react-router-dom"])}(self,function(t,e,n,r,o,i,u,a,c,f,l,s){return function(){var p,d,y,h,v,b,g={851:function(t,e,n){"use strict";n.r(e),n.d(e,{AuthLayout:function(){return I},useSignIn:function(){return R},PluginAuthClient:function(){return N},AuthenticatorsContextProvider:function(){return q},default:function(){return L},AuthenticatorsContext:function(){return l.H},useAuthenticator:function(){return l.u}});var r=n("772"),o=n("584"),i=n("741"),u=n.n(i),a={SKIP_TOKEN_RENEW:"SKIP_TOKEN_RENEW"},c=u()(function(t){t()},3e3,{leading:!0,trailing:!1}),f=n("573"),l=n("308"),s=n(581);function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function d(t,e,n,r,o,i,u){try{var a=t[i](u),c=a.value}catch(t){n(t);return}a.done?e(c):Promise.resolve(c).then(r,o)}function y(t,e,n){return(y=m()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&b(o,n.prototype),o}).apply(null,arguments)}function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function g(t){var e="function"==typeof Map?new Map:void 0;return(g=function(t){var n;if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return y(t,arguments,v(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),b(r,t)})(t)}function m(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(m=function(){return!!t})()}var x=(0,r.lazy)(function(){return s("imported_gs6osn_component",n.e("890").then(n.bind(n,387)))},"AuthProvider").AuthProvider,_=(0,r.lazy)(function(){return s("imported_kl5khg_component",n.e("938").then(n.bind(n,510)))},"Options","SignInForm","SignUpForm"),S=_.Options,w=_.SignInForm,j=_.SignUpForm,A=(0,r.lazy)(function(){return s("imported_-1ja1ffa_component",n.e("280").then(n.bind(n,492)))},"AuthLayout","SignInPage","SignUpPage"),O=A.AuthLayout,k=A.SignInPage,T=A.SignUpPage,P=(0,r.lazy)(function(){return s("imported_10vpsc8_component",n.e("851").then(n.bind(n,264)))},"Authenticator").Authenticator,E=(0,r.lazy)(function(){return s("imported_-1q5gcq5_component",n.e("104").then(n.bind(n,349)))},"TokenPolicySettings").TokenPolicySettings,C=(0,r.lazy)(function(){return s("imported_-1ja1ffa_component",n.e("280").then(n.bind(n,492)))},"AuthenticatorsContextProvider","AuthLayout"),q=C.AuthenticatorsContextProvider,I=C.AuthLayout,N=function(t){var e,n,r;function i(){var t,e,n,r,u,a,c;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,i),e=this,n=i,r=arguments,n=v(n),u=t=function(t,e){return e&&("object"===function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}(e)||"function"==typeof e)?e:function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(e,m()?Reflect.construct(n,r||[],v(e).constructor):n.apply(e,r)),a="authTypes",c=new o.Registry,a in u?Object.defineProperty(u,a,{value:c,enumerable:!0,configurable:!0,writable:!0}):u[a]=c,t}return!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e)}(i,t),e=i,n=[{key:"registerType",value:function(t,e){this.authTypes.register(t,e)}},{key:"load",value:function(){var t,e=this;return(t=function(){var t,n,r;return function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,function(o){var i,u,l;return e.app.pluginSettingsManager.add(f.A7,{icon:"LoginOutlined",title:'{{t("Authentication", { ns: "'.concat(f.A7,'" })}}'),Component:P,aclSnippet:"pm.auth.authenticators"}),e.router.add("auth",{Component:"AuthLayout"}),e.router.add("auth.signin",{path:"/signin",Component:"SignInPage"}),e.router.add("auth.signup",{path:"/signup",Component:"SignUpPage"}),e.app.addComponents({AuthLayout:O,SignInPage:k,SignUpPage:T}),e.app.providers.unshift([x,{}]),e.registerType("Email/Password",{components:{SignInForm:w,SignUpForm:j,AdminSettingsForm:S}}),e.app.pluginSettingsManager.add("security.token-policy",{title:'{{t("Token policy", { ns: "'.concat(f.A7,'" })}}'),Component:E,aclSnippet:"pm.security.token-policy",icon:"ApiOutlined",sort:0}),u=((i=({app:e.app}).app).apiClient.axios,[function(t){var e=t.headers["x-new-token"];return e&&i.apiClient.auth.setToken(e),t},function(t){var e=t.response.headers["x-new-token"];if(e&&i.apiClient.auth.setToken(e),401===t.status&&!(null===(n=t.config)||void 0===n?void 0:n.skipAuth)){var n,r,o,u,f,l=null==t?void 0:null===(o=t.config)||void 0===o?void 0:null===(r=o.headers.Authorization)||void 0===r?void 0:r.replace(/^Bearer\s+/gi,""),s=i.apiClient.auth.getToken();if(s&&s!==l)return t.config.skipNotify=!0,i.apiClient.request(t.config);i.apiClient.auth.setToken("");var p=null==t?void 0:null===(f=t.response)||void 0===f?void 0:null===(u=f.data)||void 0===u?void 0:u.errors,d=Array.isArray(p)?p[0]:null;if(!d||(null==d?void 0:d.code)===a.SKIP_TOKEN_RENEW)throw t;if((null==d?void 0:d.code)==="USER_HAS_NO_ROLES_ERR")throw i.error=d,t;var y=i.router.state.location,h=y.pathname,v=y.search,b=i.router.basename;if(h!==i.getHref("signin")){var g,m,x,_=(g=h,m=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),x=new RegExp("^".concat(m.replace(/\/?$/,""),"(\\/|$)")),g.replace(x,"/")||g);c(function(){i.apiClient.auth.setToken(null),i.router.navigate("/signin?redirect=".concat(_).concat(v),{replace:!0})})}}throw t}]),l=2,n=(t=function(t){if(Array.isArray(t))return t}(u)||function(t,e){var n,r,o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i=[],u=!0,a=!1;try{for(o=o.call(t);!(u=(n=o.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,r=t}finally{try{!u&&null!=o.return&&o.return()}finally{if(a)throw r}}return i}}(u,2)||function(t,e){if(t){if("string"==typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(t,e)}}(u,l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],r=t[1],e.app.apiClient.axios.interceptors.response.handlers.unshift({fulfilled:n,rejected:r,synchronous:!1,runWhen:null}),[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){d(i,r,o,u,a,"next",t)}function a(t){d(i,r,o,u,a,"throw",t)}u(void 0)})})()}}],h(e.prototype,n),i}(g(r.Plugin)),R=function(t){return(0,r.useLazy)(function(){return s("imported_kl5khg_component",n.e("938").then(n.bind(n,510)))},"useSignIn")(t)},L=N},308:function(t,e,n){"use strict";n.d(e,{H:function(){return o},u:function(){return i}});var r=n(156),o=(0,r.createContext)([]);o.displayName="AuthenticatorsContext";var i=function(t){return(0,r.useContext)(o).find(function(e){return e.name===t})}},573:function(t,e,n){"use strict";n.d(e,{A7:function(){return i},KQ:function(){return a},o$:function(){return u}});var r=n(238),o=n(772),i="auth";function u(){return(0,r.useTranslation)([i,"client"],{nsMode:"fallback"})}function a(t){return o.i18n.t(t,{ns:[i,"client"],nsMode:"fallback"})}},869:function(t,e,n){var r=n(31).Symbol;t.exports=r},365:function(t,e,n){var r=n(869),o=n(43),i=n(283),u=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?o(t):i(t)}},527:function(t,e,n){var r=n(670),o=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(o,""):t}},274:function(t,e,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},43:function(t,e,n){var r=n(869),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,a=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,a),n=t[a];try{t[a]=void 0;var r=!0}catch(t){}var o=u.call(t);return r&&(e?t[a]=n:delete t[a]),o}},283:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},31:function(t,e,n){var r=n(274),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},670:function(t){var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},741:function(t,e,n){var r=n(917),o=n(860),i=n(640),u=Math.max,a=Math.min;t.exports=function(t,e,n){var c,f,l,s,p,d,y=0,h=!1,v=!1,b=!0;if("function"!=typeof t)throw TypeError("Expected a function");function g(e){var n=c,r=f;return c=f=void 0,y=e,s=t.apply(r,n)}e=i(e)||0,r(n)&&(h=!!n.leading,l=(v="maxWait"in n)?u(i(n.maxWait)||0,e):l,b="trailing"in n?!!n.trailing:b);function m(t){var n=t-d,r=t-y;return void 0===d||n>=e||n<0||v&&r>=l}function x(){var t,n,r,i,u=o();if(m(u))return _(u);p=setTimeout(x,(n=(t=u)-d,r=t-y,i=e-n,v?a(i,l-r):i))}function _(t){return(p=void 0,b&&c)?g(t):(c=f=void 0,s)}function S(){var t,n=o(),r=m(n);if(c=arguments,f=this,d=n,r){if(void 0===p){;return y=t=d,p=setTimeout(x,e),h?g(t):s}if(v)return clearTimeout(p),p=setTimeout(x,e),g(d)}return void 0===p&&(p=setTimeout(x,e)),s}return S.cancel=function(){void 0!==p&&clearTimeout(p),y=0,c=d=f=p=void 0},S.flush=function(){return void 0===p?s:_(o())},S}},917:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},620:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},528:function(t,e,n){var r=n(365),o=n(620);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},860:function(t,e,n){var r=n(31);t.exports=function(){return r.Date.now()}},640:function(t,e,n){var r=n(527),o=n(917),i=n(528),u=0/0,a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,f=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return u;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=c.test(t);return n||f.test(t)?l(t.slice(2),n?2:8):a.test(t)?u:+t}},581:function(t){t.exports=function(t,e){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(t,e),e}},482:function(t){"use strict";t.exports=e},964:function(t){"use strict";t.exports=f},632:function(t){"use strict";t.exports=r},563:function(t){"use strict";t.exports=c},505:function(t){"use strict";t.exports=n},875:function(t){"use strict";t.exports=a},772:function(e){"use strict";e.exports=t},584:function(t){"use strict";t.exports=u},721:function(t){"use strict";t.exports=l},156:function(t){"use strict";t.exports=o},238:function(t){"use strict";t.exports=i},128:function(t){"use strict";t.exports=s}},m={};function x(t){var e=m[t];if(void 0!==e)return e.exports;var n=m[t]={exports:{}};return g[t](n,n.exports,x),n.exports}return x.m=g,x.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return x.d(e,{a:e}),e},x.d=function(t,e){for(var n in e)x.o(e,n)&&!x.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},x.f={},x.e=function(t){return Promise.all(Object.keys(x.f).reduce(function(e,n){return x.f[n](t,e),e},[]))},x.u=function(t){return""+({104:"88ef1c520c08b674",280:"9e603524b127e7b4",851:"974ac9de644a1d1f",890:"43e9587ca4936ffe",938:"0091d4359312cb07"})[t]+".js"},x.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),x.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},p={},d="@nocobase/plugin-auth:",x.l=function(t,e,n,r){if(p[t]){p[t].push(e);return}if(void 0!==n){for(var o,i,u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var c=u[a];if(c.getAttribute("src")==t||c.getAttribute("data-webpack")==d+n){o=c;break}}}!o&&(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,x.nc&&o.setAttribute("nonce",x.nc),o.setAttribute("data-webpack",d+n),o.src=t),p[t]=[e];var f=function(e,n){o.onerror=o.onload=null,clearTimeout(l);var r=p[t];if(delete p[t],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(t){return t(n)}),e)return e(n)},l=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),i&&document.head.appendChild(o)},x.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},x.p=(!(y=window.__nocobase_public_path__||"/").endsWith("/")&&(y+="/"),y+"static/plugins/@nocobase/plugin-auth/dist/client/"),h={909:0},x.f.j=function(t,e){var n=x.o(h,t)?h[t]:void 0;if(0!==n){if(n)e.push(n[2]);else{var r=new Promise(function(e,r){n=h[t]=[e,r]});e.push(n[2]=r);var o=x.p+x.u(t),i=Error();x.l(o,function(e){if(x.o(h,t)&&(0!==(n=h[t])&&(h[t]=void 0),n)){var r=e&&("load"===e.type?"missing":e.type),o=e&&e.target&&e.target.src;i.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+t,t)}}},v=function(t,e){var n=e[0],r=e[1],o=e[2],i,u,a=0;if(n.some(function(t){return 0!==h[t]})){for(i in r)x.o(r,i)&&(x.m[i]=r[i]);o&&o(x)}for(t&&t(e);a<n.length;a++)u=n[a],x.o(h,u)&&h[u]&&h[u][0](),h[u]=0},(b=self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).forEach(v.bind(null,0)),b.push=v.bind(null,b.push.bind(b)),x("851")}()});
|
|
@@ -10,4 +10,4 @@ import { Application } from '@nocobase/client';
|
|
|
10
10
|
import type { AxiosResponse } from 'axios';
|
|
11
11
|
export declare function authCheckMiddleware({ app }: {
|
|
12
12
|
app: Application;
|
|
13
|
-
}): ((res: AxiosResponse) => AxiosResponse<any, any>)[];
|
|
13
|
+
}): (((res: AxiosResponse) => AxiosResponse<any, any>) | ((error: any) => Promise<AxiosResponse<any, any>>))[];
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.6.0-alpha.
|
|
11
|
+
"@nocobase/client": "1.6.0-alpha.22",
|
|
12
12
|
"react": "18.2.0",
|
|
13
|
-
"@nocobase/utils": "1.6.0-alpha.
|
|
13
|
+
"@nocobase/utils": "1.6.0-alpha.22",
|
|
14
14
|
"axios": "1.7.7",
|
|
15
15
|
"lodash": "4.17.21",
|
|
16
|
-
"@nocobase/auth": "1.6.0-alpha.
|
|
17
|
-
"@nocobase/database": "1.6.0-alpha.
|
|
18
|
-
"@nocobase/cache": "1.6.0-alpha.
|
|
19
|
-
"@nocobase/server": "1.6.0-alpha.
|
|
20
|
-
"@nocobase/logger": "1.6.0-alpha.
|
|
21
|
-
"@nocobase/test": "1.6.0-alpha.
|
|
16
|
+
"@nocobase/auth": "1.6.0-alpha.22",
|
|
17
|
+
"@nocobase/database": "1.6.0-alpha.22",
|
|
18
|
+
"@nocobase/cache": "1.6.0-alpha.22",
|
|
19
|
+
"@nocobase/server": "1.6.0-alpha.22",
|
|
20
|
+
"@nocobase/logger": "1.6.0-alpha.22",
|
|
21
|
+
"@nocobase/test": "1.6.0-alpha.22",
|
|
22
22
|
"@formily/antd-v5": "1.1.9",
|
|
23
23
|
"antd": "5.12.8",
|
|
24
24
|
"@formily/shared": "2.3.2",
|
|
@@ -27,6 +27,6 @@ module.exports = {
|
|
|
27
27
|
"react-i18next": "11.18.6",
|
|
28
28
|
"@emotion/css": "11.13.0",
|
|
29
29
|
"@ant-design/icons": "5.2.6",
|
|
30
|
-
"@nocobase/actions": "1.6.0-alpha.
|
|
30
|
+
"@nocobase/actions": "1.6.0-alpha.22",
|
|
31
31
|
"@formily/core": "2.3.0"
|
|
32
32
|
};
|
package/dist/locale/en-US.json
CHANGED
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"Password is not allowed to be changed": "Password is not allowed to be changed",
|
|
33
33
|
"Token policy": "Token policy",
|
|
34
34
|
"Token validity period": "Token validity period",
|
|
35
|
-
"Session validity": "Session validity",
|
|
35
|
+
"Session validity period": "Session validity period",
|
|
36
36
|
"Expired token refresh limit": "Expired token refresh limit",
|
|
37
|
-
"
|
|
37
|
+
"Token validity period must be less than session validity period!": "Token validity period must be less than session validity period!",
|
|
38
38
|
"Seconds": "Seconds",
|
|
39
39
|
"Minutes": "Minutes",
|
|
40
40
|
"Hours": "Hours",
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"At least one of the username or email fields is required": "至少需要设置用户名或邮箱中的一个字段为必填字段",
|
|
32
32
|
"Password is not allowed to be changed": "密码不允许修改",
|
|
33
33
|
"Token policy": "Token 策略",
|
|
34
|
-
"Token validity period": "Token
|
|
35
|
-
"Session validity": "会话有效期",
|
|
34
|
+
"Token validity period": "Token 有效期",
|
|
35
|
+
"Session validity period": "会话有效期",
|
|
36
36
|
"Expired token refresh limit": "过期 Token 刷新时限",
|
|
37
|
-
"
|
|
37
|
+
"Token validity period must be less than session validity period!": "Token 有效期必须小于会话有效期!",
|
|
38
38
|
"Seconds": "秒",
|
|
39
39
|
"Minutes": "分钟",
|
|
40
40
|
"Hours": "小时",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cron","description":"Cron jobs for your node","version":"2.4.4","author":"Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)","bugs":{"url":"https://github.com/kelektiv/node-cron/issues"},"repository":{"type":"git","url":"https://github.com/kelektiv/node-cron.git"},"main":"lib/cron","scripts":{"lint":"eslint {lib,tests}/*.js","test":"jest --coverage","test:watch":"jest --watch --coverage","test:types":"tsd","prepare":"husky install","release":"semantic-release"},"types":"types/index.d.ts","dependencies":{"@types/luxon":"~3.3.0","luxon":"~3.3.0"},"devDependencies":{"@commitlint/cli":"~17.6.6","@insurgentlab/commitlint-config":"^18.1.0","@insurgentlab/conventional-changelog-preset":"~6.0.3","@semantic-release/changelog":"~6.0.x","@semantic-release/commit-analyzer":"~9.0.x","@semantic-release/git":"~10.0.x","@semantic-release/github":"~8.1.x","@semantic-release/npm":"~10.0.x","@semantic-release/release-notes-generator":"~11.0.x","chai":"~4.2.x","eslint":"~8.36.x","eslint-config-prettier":"^8.7.x","eslint-config-standard":"~17.0.x","eslint-plugin-import":"~2.27.x","eslint-plugin-jest":"~27.2.x","eslint-plugin-n":"~15.6.x","eslint-plugin-prettier":"~4.2.x","eslint-plugin-promise":"~6.1.x","husky":"^8.0.3","jest":"~29.5.x","prettier":"~2.8.x","semantic-release":"~21.0.x","sinon":"^15.0.x","tsd":"^0.28.1"},"keywords":["cron","node cron","node-cron","schedule","scheduler","cronjob","cron job"],"license":"MIT","contributors":["Brandon der Blätter <https://interlucid.com/contact/> (https://github.com/intcreator)","Romain Beauxis <toots@rastageeks.org> (https://github.com/toots)","James Padolsey <> (https://github.com/jamespadolsey)","Finn Herpich <fh@three-heads.de> (https://github.com/ErrorProne)","Clifton Cunningham <clifton.cunningham@gmail.com> (https://github.com/cliftonc)","Eric Abouaf <eric.abouaf@gmail.com> (https://github.com/neyric)","humanchimp <morphcham@gmail.com> (https://github.com/humanchimp)","Craig Condon <craig@spiceapps.com> (https://github.com/spiceapps)","Dan Bear <daniel@hulu.com> (https://github.com/danhbear)","Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)","Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)","Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)","Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)","Masakazu Matsushita <matsukaz@gmail.com> (matsukaz)","Christopher Lunt <me@kirisu.co.uk> (https://github.com/kirisu)"],"jest":{"collectCoverage":true,"collectCoverageFrom":["lib/*.js"],"coverageThreshold":{"global":{"statements":80,"branches":80,"functions":70,"lines":80}}},"files":["lib","types","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"2025-02-
|
|
1
|
+
{"name":"cron","description":"Cron jobs for your node","version":"2.4.4","author":"Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)","bugs":{"url":"https://github.com/kelektiv/node-cron/issues"},"repository":{"type":"git","url":"https://github.com/kelektiv/node-cron.git"},"main":"lib/cron","scripts":{"lint":"eslint {lib,tests}/*.js","test":"jest --coverage","test:watch":"jest --watch --coverage","test:types":"tsd","prepare":"husky install","release":"semantic-release"},"types":"types/index.d.ts","dependencies":{"@types/luxon":"~3.3.0","luxon":"~3.3.0"},"devDependencies":{"@commitlint/cli":"~17.6.6","@insurgentlab/commitlint-config":"^18.1.0","@insurgentlab/conventional-changelog-preset":"~6.0.3","@semantic-release/changelog":"~6.0.x","@semantic-release/commit-analyzer":"~9.0.x","@semantic-release/git":"~10.0.x","@semantic-release/github":"~8.1.x","@semantic-release/npm":"~10.0.x","@semantic-release/release-notes-generator":"~11.0.x","chai":"~4.2.x","eslint":"~8.36.x","eslint-config-prettier":"^8.7.x","eslint-config-standard":"~17.0.x","eslint-plugin-import":"~2.27.x","eslint-plugin-jest":"~27.2.x","eslint-plugin-n":"~15.6.x","eslint-plugin-prettier":"~4.2.x","eslint-plugin-promise":"~6.1.x","husky":"^8.0.3","jest":"~29.5.x","prettier":"~2.8.x","semantic-release":"~21.0.x","sinon":"^15.0.x","tsd":"^0.28.1"},"keywords":["cron","node cron","node-cron","schedule","scheduler","cronjob","cron job"],"license":"MIT","contributors":["Brandon der Blätter <https://interlucid.com/contact/> (https://github.com/intcreator)","Romain Beauxis <toots@rastageeks.org> (https://github.com/toots)","James Padolsey <> (https://github.com/jamespadolsey)","Finn Herpich <fh@three-heads.de> (https://github.com/ErrorProne)","Clifton Cunningham <clifton.cunningham@gmail.com> (https://github.com/cliftonc)","Eric Abouaf <eric.abouaf@gmail.com> (https://github.com/neyric)","humanchimp <morphcham@gmail.com> (https://github.com/humanchimp)","Craig Condon <craig@spiceapps.com> (https://github.com/spiceapps)","Dan Bear <daniel@hulu.com> (https://github.com/danhbear)","Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)","Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)","Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)","Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)","Masakazu Matsushita <matsukaz@gmail.com> (matsukaz)","Christopher Lunt <me@kirisu.co.uk> (https://github.com/kirisu)"],"jest":{"collectCoverage":true,"collectCoverageFrom":["lib/*.js"],"coverageThreshold":{"global":{"statements":80,"branches":80,"functions":70,"lines":80}}},"files":["lib","types","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"2025-02-07T08:52:37.582Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"ms","version":"2.1.3","description":"Tiny millisecond conversion utility","repository":"vercel/ms","main":"./index","files":["index.js"],"scripts":{"precommit":"lint-staged","lint":"eslint lib/* bin/*","test":"mocha tests.js"},"eslintConfig":{"extends":"eslint:recommended","env":{"node":true,"es6":true}},"lint-staged":{"*.js":["npm run lint","prettier --single-quote --write","git add"]},"license":"MIT","devDependencies":{"eslint":"4.18.2","expect.js":"0.3.1","husky":"0.14.3","lint-staged":"5.0.0","mocha":"4.0.1","prettier":"2.0.5"},"_lastModified":"2025-02-
|
|
1
|
+
{"name":"ms","version":"2.1.3","description":"Tiny millisecond conversion utility","repository":"vercel/ms","main":"./index","files":["index.js"],"scripts":{"precommit":"lint-staged","lint":"eslint lib/* bin/*","test":"mocha tests.js"},"eslintConfig":{"extends":"eslint:recommended","env":{"node":true,"es6":true}},"lint-staged":{"*.js":["npm run lint","prettier --single-quote --write","git add"]},"license":"MIT","devDependencies":{"eslint":"4.18.2","expect.js":"0.3.1","husky":"0.14.3","lint-staged":"5.0.0","mocha":"4.0.1","prettier":"2.0.5"},"_lastModified":"2025-02-07T08:52:37.671Z"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-auth",
|
|
3
|
-
"version": "1.6.0-alpha.
|
|
3
|
+
"version": "1.6.0-alpha.22",
|
|
4
4
|
"main": "./dist/server/index.js",
|
|
5
5
|
"homepage": "https://docs.nocobase.com/handbook/auth",
|
|
6
6
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/auth",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"displayName.zh-CN": "用户认证",
|
|
28
28
|
"description": "User authentication management, including password, SMS, and support for Single Sign-On (SSO) protocols, with extensibility.",
|
|
29
29
|
"description.zh-CN": "用户认证管理,包括基础的密码认证、短信认证、SSO 协议的认证等,可扩展。",
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "ff8764febe306023bd6d56f0d9612d7a03170006",
|
|
31
31
|
"keywords": [
|
|
32
32
|
"Authentication",
|
|
33
33
|
"Security"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
"use strict";(self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).push([["104"],{349:function(e,t,n){n.r(t),n.d(t,{TokenPolicySettings:function(){return T}});var r,o=n("156"),i=n.n(o),a=n("772"),u=n("721"),c=n("875"),l=n("584"),s=n("573"),f=n("505"),p=n("563"),m="token-policy-config",y="tokenControlConfig";function h(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){h(i,r,o,a,u,"next",e)}function u(e){h(i,r,o,a,u,"throw",e)}a(void 0)})}}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var g="useSubmitActionProps",w="useEditForm",x=(b(r={},w,function(){var e=(0,a.useAPIClient)(),t=(0,o.useMemo)(function(){return(0,p.createForm)()},[]);return(0,o.useEffect)(function(){var n;(n=d(function(){var n,r;return v(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e.resource(y).get({filterByTk:m})];case 1:return(null==(r=o.sent().data)?void 0:null===(n=r.data)||void 0===n?void 0:n.config)&&t.setValues(r.data.config),[3,3];case 2:return console.error(o.sent()),[3,3];case 3:return[2]}})}),function(){return n.apply(this,arguments)})()},[t,e]),{form:t}}),b(r,g,function(){var e=u.App.useApp().message,t=(0,a.useAPIClient)(),n=(0,f.useForm)(),r=(0,s.o$)().t;return{type:"primary",onClick:function(){return d(function(){var o;return v(this,function(i){switch(i.label){case 0:return[4,n.submit()];case 1:return i.sent(),[4,t.resource(y).update({values:{config:n.values},filterByTk:m})];case 2:return(o=i.sent())&&200===o.status&&e.success(r("Saved successfully!")),[2]}})})()}}}),r);function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var S=u.Select.Option,j=(0,f.connect)(function(e){var t,n,r=(0,s.o$)().t,a=e.value,c=e.onChange,l=e.minNum,f=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["value","onChange","minNum"]),p=a?a.match(/^(\d*)([a-zA-Z]*)$/):null;(0,o.useEffect)(function(){!p&&c("10m")},[p,c]);var m=(t=p?[parseInt(p[1]),p[2]]:[10,"m"],n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(u)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k(e,t)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=m[0],h=m[1],d=i().createElement(u.Select,{value:h,onChange:function(e){return c("".concat(y).concat(e))},style:{width:120}},i().createElement(S,{value:"m"},r("Minutes")),i().createElement(S,{value:"h"},r("Hours")),i().createElement(S,{value:"d"},r("Days")));return i().createElement(u.InputNumber,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){O(e,t,n[t])})}return e}({value:y,addonAfter:d,min:void 0===l?1:l,onChange:function(e){return c("".concat(null!=e?e:1).concat(h))}},f))},(0,f.mapProps)({onInput:"onChange"})),A="InputTime",E=O({},A,j),P={name:(0,c.uid)(),"x-component":"FormV2","x-use-component-props":w,type:"object",properties:{sessionExpirationTime:{type:"string",title:"{{t('Session validity')}}","x-decorator":"FormItem","x-component":A,required:!0,description:(0,l.tval)("The maximum valid time for each user login. During the session validity, the Token will be automatically updated. After the timeout, the user is required to log in again.")},tokenExpirationTime:{type:"string",title:"{{t('Token validity period')}}","x-decorator":"FormItem","x-component":A,required:!0,description:(0,l.tval)("The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)")},expiredTokenRenewLimit:{type:"string",title:"{{t('Expired token refresh limit')}}","x-decorator":"FormItem","x-component":A,"x-component-props":{minNum:0},required:!0,description:(0,l.tval)("The maximum time limit allowed for refreshing a Token after it expires. After this time limit, the token cannot be automatically renewed, and the user needs to log in again.")},footer:{type:"void","x-component":"ActionBar","x-component-props":{layout:"one-column"},properties:{submit:{title:'{{t("Submit")}}',"x-component":"Action","x-use-component-props":g}}}}},T=function(){var e=(0,s.o$)().t;return i().createElement(u.Card,{bordered:!1},i().createElement(a.SchemaComponent,{schema:P,scope:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({t:e},x),components:E}))}}}]);
|