@nocobase/plugin-auth 1.6.0-alpha.14 → 1.6.0-alpha.16

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.
Files changed (31) hide show
  1. package/dist/client/{1c5e32ff8bef5e4a.js → 974ac9de644a1d1f.js} +1 -1
  2. package/dist/client/{6992b2fd9b0275b1.js → 9e603524b127e7b4.js} +1 -1
  3. package/dist/client/dfc184578d2220ec.js +10 -0
  4. package/dist/client/index.d.ts +1 -1
  5. package/dist/client/index.js +1 -1
  6. package/dist/client/interceptors.d.ts +13 -0
  7. package/dist/client/settings/token-policy/components.d.ts +15 -0
  8. package/dist/client/settings/token-policy/hooks.d.ts +24 -0
  9. package/dist/client/settings/token-policy/index.d.ts +10 -0
  10. package/dist/constants.d.ts +12 -0
  11. package/dist/constants.js +45 -0
  12. package/dist/externalVersion.js +11 -8
  13. package/dist/locale/en-US.json +17 -1
  14. package/dist/locale/zh-CN.json +16 -1
  15. package/dist/node_modules/cron/package.json +1 -1
  16. package/dist/node_modules/ms/index.js +1 -0
  17. package/dist/node_modules/ms/package.json +1 -0
  18. package/dist/server/collections/issued-tokens.d.ts +10 -0
  19. package/dist/server/collections/issued-tokens.js +69 -0
  20. package/dist/server/collections/token-poilcy-config.d.ts +10 -0
  21. package/dist/server/collections/token-poilcy-config.js +56 -0
  22. package/dist/server/index.d.ts +1 -0
  23. package/dist/server/index.js +4 -1
  24. package/dist/server/migrations/20241229080941-create-token-policy-config.d.ts +14 -0
  25. package/dist/server/migrations/20241229080941-create-token-policy-config.js +58 -0
  26. package/dist/server/plugin.js +72 -23
  27. package/dist/server/token-controller.d.ts +40 -0
  28. package/dist/server/token-controller.js +161 -0
  29. package/dist/types.d.ts +9 -0
  30. package/dist/types.js +24 -0
  31. package/package.json +5 -3
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- "use strict";(self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).push([["851"],{264:function(e,t,o){o.r(t),o.d(t,{Authenticator:function(){return T}});var n=o("772"),r=o("721"),i=o("156"),c=o.n(i),a=o("875"),p=o("238"),l=(0,i.createContext)({type:""});l.displayName="AuthTypeContext";var u=(0,i.createContext)({types:[]});u.displayName="AuthTypesContext";function s(e,t,o,n,r,i,c){try{var a=e[i](c),p=a.value}catch(e){o(e);return}a.done?t(p):Promise.resolve(p).then(n,r)}var m={name:"authenticators",sortable:!0,fields:[{name:"id",type:"string",interface:"id"},{interface:"input",type:"string",name:"name",uiSchema:{type:"string",title:'{{t("Auth UID")}}',"x-component":"Input","x-validator":function(e){return/^[a-zA-Z0-9_-]+$/.test(e)?"":n.i18n.t("a-z, A-Z, 0-9, _, -")},required:!0}},{interface:"input",type:"string",name:"authType",uiSchema:{type:"string",title:'{{t("Auth Type")}}',"x-component":"Select",dataSource:"{{ types }}",required:!0}},{interface:"input",type:"string",name:"title",uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}},{interface:"textarea",type:"string",name:"description",uiSchema:{type:"string",title:'{{t("Description")}}',"x-component":"Input"}},{type:"boolean",name:"enabled",uiSchema:{type:"boolean",title:'{{t("Enabled")}}',"x-component":"Checkbox"}}]},y={type:"object",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:function(e){var t,o,r=(0,n.useActionContext)(),c=(0,i.useContext)(l).type;return(0,n.useRequest)(function(){return Promise.resolve({data:{name:"s_".concat((0,a.uid)()),authType:c}})},(t=function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),n.forEach(function(t){var n,r,i;n=e,r=t,i=o[t],r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i})}return e}({},e),o=(o={refreshDeps:[r.visible]},o),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t))}},title:'{{t("Add new")}}',properties:{name:{"x-component":"CollectionField","x-decorator":"FormItem"},authType:{"x-component":"CollectionField","x-decorator":"FormItem","x-component-props":{options:"{{ types }}"}},title:{"x-component":"CollectionField","x-decorator":"FormItem"},description:{"x-component":"CollectionField","x-decorator":"FormItem"},enabled:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"Options"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}}}}},d={type:"void",name:"authenticators","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:m,resourceName:"authenticators",dragSort:!0,request:{resource:"authenticators",action:"list",params:{pageSize:50,sort:"sort",appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:m},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{t("Delete")}}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"AddNew","x-component-props":{type:"primary"}}}},table:{type:"void","x-uid":"input","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}",useAction:function(){var e=(0,n.useAPIClient)(),t=(0,p.useTranslation)().t;return{move:function(o,n){var i;return(i=function(){return function(e,t){var o,n,r,i,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(o)throw TypeError("Generator is already executing.");for(;c;)try{if(o=1,n&&(r=2&i[0]?n.return:i[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,i[1])).done)return r;switch(n=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,n=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(r=(r=c.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){c.label=i[1];break}if(6===i[0]&&c.label<r[1]){c.label=r[1],r=i;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(i);break}r[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],n=0}finally{o=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,function(i){switch(i.label){case 0:return[4,e.resource("authenticators").move({sourceId:o.id,targetId:n.id})];case 1:return i.sent(),r.message.success(t("Saved successfully"),.2),[2]}})},function(){var e=this,t=arguments;return new Promise(function(o,n){var r=i.apply(e,t);function c(e){s(r,o,n,c,a,"next",e)}function a(e){s(r,o,n,c,a,"throw",e)}c(void 0)})})()}}}},properties:{id:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{id:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},authType:{title:'{{t("Auth Type")}}',type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{authType:{type:"string","x-component":"Select","x-read-pretty":!0,enum:"{{ types }}"}}},title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},description:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{description:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},enabled:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{enabled:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{update:{type:"void",title:'{{t("Configure")}}',"x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{t("Configure")}}',properties:{name:{"x-component":"CollectionField","x-decorator":"FormItem"},authType:{"x-component":"CollectionField","x-decorator":"FormItem","x-component-props":{options:"{{ types }}"}},title:{"x-component":"CollectionField","x-decorator":"FormItem"},description:{"x-component":"CollectionField","x-decorator":"FormItem"},enabled:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"Options"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{cm.useDestroyAction}}"},"x-disabled":"{{ useCanNotDelete() }}"}}}}}}}}},f=o("482"),b=o("505"),x=o("437");function v(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),n.forEach(function(t){var n,r,i;n=e,r=t,i=o[t],r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i})}return e}var h=function(e){var t,o,r=(0,n.useRecord)();var c=(0,n.useRequest)(function(){return Promise.resolve({data:v({},r.options)})},(t=v({},e),o=(o={manual:!0},o),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t)),a=c.run,p=(0,n.useActionContext)();return(0,i.useEffect)(function(){p.visible&&a()},[p.visible,a]),c},O=function(e){var t,o=(0,n.usePlugin)(x.default).authTypes.get(e);return null==o?void 0:null===(t=o.components)||void 0===t?void 0:t.AdminSettingsForm},g=(0,b.observer)(function(){var e=(0,b.useForm)(),t=(0,n.useRecord)(),o=O(e.values.authType||t.authType);return o?c().createElement(o,null):null},{displayName:"Options"}),w=o("573");function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function A(e,t,o,n,r,i,c){try{var a=e[i](c),p=a.value}catch(e){o(e);return}a.done?t(p):Promise.resolve(p).then(n,r)}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o,n,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);c=!0);}catch(e){a=!0,n=e}finally{try{!c&&null!=r.return&&r.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);if("Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o)return Array.from(o);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return C(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var P=function(){var e=(0,n.useActionContext)().setVisible;return{run:function(){var t;return(t=function(){return function(e,t){var o,n,r,i,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(o)throw TypeError("Generator is already executing.");for(;c;)try{if(o=1,n&&(r=2&i[0]?n.return:i[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,i[1])).done)return r;switch(n=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,n=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(r=(r=c.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){c.label=i[1];break}if(6===i[0]&&c.label<r[1]){c.label=r[1],r=i;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(i);break}r[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],n=0}finally{o=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,function(t){return e(!1),[2]})},function(){var e=this,o=arguments;return new Promise(function(n,r){var i=t.apply(e,o);function c(e){A(i,n,r,c,a,"next",e)}function a(e){A(i,n,r,c,a,"throw",e)}c(void 0)})})()}}},S=function(){var e=(0,p.useTranslation)().t,t=j((0,i.useState)(!1),2),o=t[0],a=t[1],s=j((0,i.useState)(""),2),m=s[0],d=s[1],b=(0,i.useContext)(u).types,x=b.map(function(e){var t,o;return t=function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),n.forEach(function(t){var n,r,i;n=e,r=t,i=o[t],r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i})}return e}({},e),o=(o={onClick:function(){a(!0),d(e.value)}},o),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t});return c().createElement(n.ActionContextProvider,{value:{visible:o,setVisible:a}},c().createElement(l.Provider,{value:{type:m}},c().createElement(r.Dropdown,{menu:{items:x}},c().createElement(r.Button,{icon:c().createElement(f.PlusOutlined,null),type:"primary"},e("Add new")," ",c().createElement(f.DownOutlined,null))),c().createElement(n.SchemaComponent,{scope:{useCloseAction:P,types:b,setType:d},schema:y})))},D=function(){return(0,n.useAsyncData)().data,!1},T=function(){var e=(0,w.o$)().t,t=j((0,i.useState)([]),2),o=t[0],a=t[1],p=(0,n.useAPIClient)();return(0,n.useRequest)(function(){return p.resource("authenticators").listTypes().then(function(t){var o;return((null==t?void 0:null===(o=t.data)||void 0===o?void 0:o.data)||[]).map(function(t){return{key:t.name,label:b.Schema.compile(t.title||t.name,{t:e}),value:t.name}})})},{onSuccess:function(e){a(e)}}),c().createElement(r.Card,{bordered:!1},c().createElement(u.Provider,{value:{types:o}},c().createElement(n.SchemaComponent,{schema:d,components:{AddNew:S,Options:g},scope:{types:o,useValuesFromOptions:h,useCanNotDelete:D,t:e}})))}}}]);
10
+ "use strict";(self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).push([["851"],{264:function(e,t,o){o.r(t),o.d(t,{Authenticator:function(){return T}});var n=o("772"),r=o("721"),i=o("156"),c=o.n(i),a=o("875"),p=o("238"),l=(0,i.createContext)({type:""});l.displayName="AuthTypeContext";var u=(0,i.createContext)({types:[]});u.displayName="AuthTypesContext";function s(e,t,o,n,r,i,c){try{var a=e[i](c),p=a.value}catch(e){o(e);return}a.done?t(p):Promise.resolve(p).then(n,r)}var m={name:"authenticators",sortable:!0,fields:[{name:"id",type:"string",interface:"id"},{interface:"input",type:"string",name:"name",uiSchema:{type:"string",title:'{{t("Auth UID")}}',"x-component":"Input","x-validator":function(e){return/^[a-zA-Z0-9_-]+$/.test(e)?"":n.i18n.t("a-z, A-Z, 0-9, _, -")},required:!0}},{interface:"input",type:"string",name:"authType",uiSchema:{type:"string",title:'{{t("Auth Type")}}',"x-component":"Select",dataSource:"{{ types }}",required:!0}},{interface:"input",type:"string",name:"title",uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}},{interface:"textarea",type:"string",name:"description",uiSchema:{type:"string",title:'{{t("Description")}}',"x-component":"Input"}},{type:"boolean",name:"enabled",uiSchema:{type:"boolean",title:'{{t("Enabled")}}',"x-component":"Checkbox"}}]},y={type:"object",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:function(e){var t,o,r=(0,n.useActionContext)(),c=(0,i.useContext)(l).type;return(0,n.useRequest)(function(){return Promise.resolve({data:{name:"s_".concat((0,a.uid)()),authType:c}})},(t=function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),n.forEach(function(t){var n,r,i;n=e,r=t,i=o[t],r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i})}return e}({},e),o=(o={refreshDeps:[r.visible]},o),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t))}},title:'{{t("Add new")}}',properties:{name:{"x-component":"CollectionField","x-decorator":"FormItem"},authType:{"x-component":"CollectionField","x-decorator":"FormItem","x-component-props":{options:"{{ types }}"}},title:{"x-component":"CollectionField","x-decorator":"FormItem"},description:{"x-component":"CollectionField","x-decorator":"FormItem"},enabled:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"Options"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}}}}},d={type:"void",name:"authenticators","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:m,resourceName:"authenticators",dragSort:!0,request:{resource:"authenticators",action:"list",params:{pageSize:50,sort:"sort",appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:m},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{t("Delete")}}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"AddNew","x-component-props":{type:"primary"}}}},table:{type:"void","x-uid":"input","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}",useAction:function(){var e=(0,n.useAPIClient)(),t=(0,p.useTranslation)().t;return{move:function(o,n){var i;return(i=function(){return function(e,t){var o,n,r,i,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(o)throw TypeError("Generator is already executing.");for(;c;)try{if(o=1,n&&(r=2&i[0]?n.return:i[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,i[1])).done)return r;switch(n=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,n=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(r=(r=c.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){c.label=i[1];break}if(6===i[0]&&c.label<r[1]){c.label=r[1],r=i;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(i);break}r[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],n=0}finally{o=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,function(i){switch(i.label){case 0:return[4,e.resource("authenticators").move({sourceId:o.id,targetId:n.id})];case 1:return i.sent(),r.message.success(t("Saved successfully"),.2),[2]}})},function(){var e=this,t=arguments;return new Promise(function(o,n){var r=i.apply(e,t);function c(e){s(r,o,n,c,a,"next",e)}function a(e){s(r,o,n,c,a,"throw",e)}c(void 0)})})()}}}},properties:{id:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{id:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},authType:{title:'{{t("Auth Type")}}',type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{authType:{type:"string","x-component":"Select","x-read-pretty":!0,enum:"{{ types }}"}}},title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},description:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{description:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},enabled:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{enabled:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{update:{type:"void",title:'{{t("Configure")}}',"x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{t("Configure")}}',properties:{name:{"x-component":"CollectionField","x-decorator":"FormItem"},authType:{"x-component":"CollectionField","x-decorator":"FormItem","x-component-props":{options:"{{ types }}"}},title:{"x-component":"CollectionField","x-decorator":"FormItem"},description:{"x-component":"CollectionField","x-decorator":"FormItem"},enabled:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"Options"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{cm.useDestroyAction}}"},"x-disabled":"{{ useCanNotDelete() }}"}}}}}}}}},f=o("482"),b=o("505"),x=o("851");function v(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),n.forEach(function(t){var n,r,i;n=e,r=t,i=o[t],r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i})}return e}var h=function(e){var t,o,r=(0,n.useRecord)();var c=(0,n.useRequest)(function(){return Promise.resolve({data:v({},r.options)})},(t=v({},e),o=(o={manual:!0},o),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t)),a=c.run,p=(0,n.useActionContext)();return(0,i.useEffect)(function(){p.visible&&a()},[p.visible,a]),c},O=function(e){var t,o=(0,n.usePlugin)(x.default).authTypes.get(e);return null==o?void 0:null===(t=o.components)||void 0===t?void 0:t.AdminSettingsForm},g=(0,b.observer)(function(){var e=(0,b.useForm)(),t=(0,n.useRecord)(),o=O(e.values.authType||t.authType);return o?c().createElement(o,null):null},{displayName:"Options"}),w=o("573");function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function A(e,t,o,n,r,i,c){try{var a=e[i](c),p=a.value}catch(e){o(e);return}a.done?t(p):Promise.resolve(p).then(n,r)}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o,n,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);c=!0);}catch(e){a=!0,n=e}finally{try{!c&&null!=r.return&&r.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);if("Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o)return Array.from(o);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return C(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var P=function(){var e=(0,n.useActionContext)().setVisible;return{run:function(){var t;return(t=function(){return function(e,t){var o,n,r,i,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(o)throw TypeError("Generator is already executing.");for(;c;)try{if(o=1,n&&(r=2&i[0]?n.return:i[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,i[1])).done)return r;switch(n=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,n=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(r=(r=c.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){c.label=i[1];break}if(6===i[0]&&c.label<r[1]){c.label=r[1],r=i;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(i);break}r[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],n=0}finally{o=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,function(t){return e(!1),[2]})},function(){var e=this,o=arguments;return new Promise(function(n,r){var i=t.apply(e,o);function c(e){A(i,n,r,c,a,"next",e)}function a(e){A(i,n,r,c,a,"throw",e)}c(void 0)})})()}}},S=function(){var e=(0,p.useTranslation)().t,t=j((0,i.useState)(!1),2),o=t[0],a=t[1],s=j((0,i.useState)(""),2),m=s[0],d=s[1],b=(0,i.useContext)(u).types,x=b.map(function(e){var t,o;return t=function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),n.forEach(function(t){var n,r,i;n=e,r=t,i=o[t],r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i})}return e}({},e),o=(o={onClick:function(){a(!0),d(e.value)}},o),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t});return c().createElement(n.ActionContextProvider,{value:{visible:o,setVisible:a}},c().createElement(l.Provider,{value:{type:m}},c().createElement(r.Dropdown,{menu:{items:x}},c().createElement(r.Button,{icon:c().createElement(f.PlusOutlined,null),type:"primary"},e("Add new")," ",c().createElement(f.DownOutlined,null))),c().createElement(n.SchemaComponent,{scope:{useCloseAction:P,types:b,setType:d},schema:y})))},D=function(){return(0,n.useAsyncData)().data,!1},T=function(){var e=(0,w.o$)().t,t=j((0,i.useState)([]),2),o=t[0],a=t[1],p=(0,n.useAPIClient)();return(0,n.useRequest)(function(){return p.resource("authenticators").listTypes().then(function(t){var o;return((null==t?void 0:null===(o=t.data)||void 0===o?void 0:o.data)||[]).map(function(t){return{key:t.name,label:b.Schema.compile(t.title||t.name,{t:e}),value:t.name}})})},{onSuccess:function(e){a(e)}}),c().createElement(r.Card,{bordered:!1},c().createElement(u.Provider,{value:{types:o}},c().createElement(n.SchemaComponent,{schema:d,components:{AddNew:S,Options:g},scope:{types:o,useValuesFromOptions:h,useCanNotDelete:D,t:e}})))}}}]);
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- "use strict";(self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).push([["280"],{492:function(e,t,n){n.r(t),n.d(t,{useSignInForms:function(){return E},SignUpPage:function(){return I},AuthenticatorsContextProvider:function(){return s},AuthLayout:function(){return m},SignInPage:function(){return w},useSignInButtons:function(){return P},SignupPageProvider:function(){return j},useSignUpForms:function(){return A},SignupPageContext:function(){return O}});var r=n("964"),a=n("772"),o=n("721"),i=n("156"),u=n.n(i),l=n("128"),c=n("308");function f(){var e,t,n=(e=["\n position: absolute;\n bottom: 24px;\n width: 100%;\n left: 0;\n text-align: center;\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return f=function(){return n},n}var s=function(e){var t=e.children,n=(0,a.useAPIClient)(),r=(0,a.useRequest)(function(){return n.resource("authenticators").publicList().then(function(e){var t;return(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.data)||[]})}),i=r.data,l=r.error;if(r.loading)return u().createElement("div",{style:{textAlign:"center",marginTop:20}},u().createElement(o.Spin,null));if(l)throw l;return u().createElement(c.H.Provider,{value:void 0===i?[]:i},t)};function m(){var e,t=((0,a.useSystemSettings)()||{}).data;return u().createElement("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh"}},u().createElement("div",{style:{position:"fixed",top:"2em",right:"2em"}},u().createElement(a.SwitchLanguage,null)),u().createElement("h1",{style:{textAlign:"center"}},u().createElement(a.ReadPretty.TextArea,{value:null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.title})),u().createElement(s,null,u().createElement(l.Outlet,null)),u().createElement("div",{className:(0,r.css)(f())},u().createElement(a.PoweredBy,null)))}var v=n("437"),y=n("573"),p=n("505");function d(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 h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,u=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){u=!0,r=e}finally{try{!i&&null!=a.return&&a.return()}finally{if(u)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(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 d(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function b(){var e=g(["\n display: flex;\n "]);return b=function(){return e},e}function S(){var e=g(["\n display: flex;\n "]);return S=function(){return e},e}var E=function(){var e=(0,a.usePlugin)(v.default).authTypes.getEntities(),t={},n=!0,r=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done);n=!0){var l,c=h(i.value,2),f=c[0],s=c[1];(null===(l=s.components)||void 0===l?void 0:l.SignInForm)&&(t[f]=s.components.SignInForm)}}catch(e){r=!0,o=e}finally{try{!n&&null!=u.return&&u.return()}finally{if(r)throw o}}return t},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,a.usePlugin)(v.default).authTypes.getEntities(),n={},r=!0,o=!1,i=void 0;try{for(var l,c=t[Symbol.iterator]();!(r=(l=c.next()).done);r=!0){var f,s=h(l.value,2),m=s[0],y=s[1];(null===(f=y.components)||void 0===f?void 0:f.SignInButton)&&(n[m]=y.components.SignInButton)}}catch(e){o=!0,i=e}finally{try{!r&&null!=c.return&&c.return()}finally{if(o)throw i}}var p=Object.keys(n);return e.filter(function(e){return p.includes(e.authType)}).map(function(e,t){return u().createElement(n[e.authType],{key:t,authenticator:e})})},w=function(){var e=(0,y.o$)().t;(0,a.useCurrentDocumentTitle)("Signin"),(0,a.useViewport)();var t=E(),n=(0,i.useContext)(c.H),l=P(n);if(!n.length)return u().createElement("div",{style:{color:"#ccc"}},e("No authentication methods available."));var f=n.map(function(n){var r=t[n.authType];if(!!r){var a="".concat(e("Sign-in")," (").concat(p.Schema.compile(n.authTypeTitle||n.authType,{t:e}),")");return 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,a,o;r=e,a=t,o=n[t],a in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o})}return e}({component:(0,i.createElement)(r,{authenticator:n}),tabTitle:n.title||a},n)}}).filter(function(e){return e});return u().createElement(o.Space,{direction:"vertical",className:(0,r.css)(b())},f.length>1?u().createElement(o.Tabs,{items:f.map(function(e){return{label:e.tabTitle,key:e.name,children:e.component}})}):f.length?u().createElement("div",null,f[0].component):u().createElement(u().Fragment,null),u().createElement(o.Space,{direction:"vertical",className:(0,r.css)(S())},l))};function T(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 x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,u=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){u=!0,r=e}finally{try{!i&&null!=a.return&&a.return()}finally{if(u)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return T(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 T(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=(0,i.createContext)({});O.displayName="SignupPageContext";var j=function(e){var t=(0,i.useContext)(O);return t[e.authType]={component:e.component},u().createElement(O.Provider,{value:t},e.children)},A=function(){var e=(0,a.usePlugin)(v.default).authTypes.getEntities(),t={},n=!0,r=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done);n=!0){var l,c=x(i.value,2),f=c[0],s=c[1];(null===(l=s.components)||void 0===l?void 0:l.SignUpForm)&&(t[f]=s.components.SignUpForm)}}catch(e){r=!0,o=e}finally{try{!n&&null!=u.return&&u.return()}finally{if(r)throw o}}return t},I=function(){(0,a.useViewport)(),(0,a.useCurrentDocumentTitle)("Signup");var e=A(),t=x((0,l.useSearchParams)(),1)[0].get("name"),n=((0,c.u)(t)||{}).authType;return e[n]?(0,i.createElement)(e[n],{authenticatorName:t}):u().createElement(l.Navigate,{to:"/not-found",replace:!0})}}}]);
10
+ "use strict";(self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).push([["280"],{492:function(e,t,n){n.r(t),n.d(t,{useSignInForms:function(){return E},SignUpPage:function(){return I},AuthenticatorsContextProvider:function(){return s},AuthLayout:function(){return m},SignInPage:function(){return w},useSignInButtons:function(){return P},SignupPageProvider:function(){return j},useSignUpForms:function(){return A},SignupPageContext:function(){return O}});var r=n("964"),a=n("772"),o=n("721"),i=n("156"),u=n.n(i),l=n("128"),c=n("308");function f(){var e,t,n=(e=["\n position: absolute;\n bottom: 24px;\n width: 100%;\n left: 0;\n text-align: center;\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return f=function(){return n},n}var s=function(e){var t=e.children,n=(0,a.useAPIClient)(),r=(0,a.useRequest)(function(){return n.resource("authenticators").publicList().then(function(e){var t;return(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.data)||[]})}),i=r.data,l=r.error;if(r.loading)return u().createElement("div",{style:{textAlign:"center",marginTop:20}},u().createElement(o.Spin,null));if(l)throw l;return u().createElement(c.H.Provider,{value:void 0===i?[]:i},t)};function m(){var e,t=((0,a.useSystemSettings)()||{}).data;return u().createElement("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh"}},u().createElement("div",{style:{position:"fixed",top:"2em",right:"2em"}},u().createElement(a.SwitchLanguage,null)),u().createElement("h1",{style:{textAlign:"center"}},u().createElement(a.ReadPretty.TextArea,{value:null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.title})),u().createElement(s,null,u().createElement(l.Outlet,null)),u().createElement("div",{className:(0,r.css)(f())},u().createElement(a.PoweredBy,null)))}var v=n("851"),y=n("573"),p=n("505");function d(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 h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,u=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){u=!0,r=e}finally{try{!i&&null!=a.return&&a.return()}finally{if(u)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(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 d(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function b(){var e=g(["\n display: flex;\n "]);return b=function(){return e},e}function S(){var e=g(["\n display: flex;\n "]);return S=function(){return e},e}var E=function(){var e=(0,a.usePlugin)(v.default).authTypes.getEntities(),t={},n=!0,r=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done);n=!0){var l,c=h(i.value,2),f=c[0],s=c[1];(null===(l=s.components)||void 0===l?void 0:l.SignInForm)&&(t[f]=s.components.SignInForm)}}catch(e){r=!0,o=e}finally{try{!n&&null!=u.return&&u.return()}finally{if(r)throw o}}return t},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,a.usePlugin)(v.default).authTypes.getEntities(),n={},r=!0,o=!1,i=void 0;try{for(var l,c=t[Symbol.iterator]();!(r=(l=c.next()).done);r=!0){var f,s=h(l.value,2),m=s[0],y=s[1];(null===(f=y.components)||void 0===f?void 0:f.SignInButton)&&(n[m]=y.components.SignInButton)}}catch(e){o=!0,i=e}finally{try{!r&&null!=c.return&&c.return()}finally{if(o)throw i}}var p=Object.keys(n);return e.filter(function(e){return p.includes(e.authType)}).map(function(e,t){return u().createElement(n[e.authType],{key:t,authenticator:e})})},w=function(){var e=(0,y.o$)().t;(0,a.useCurrentDocumentTitle)("Signin"),(0,a.useViewport)();var t=E(),n=(0,i.useContext)(c.H),l=P(n);if(!n.length)return u().createElement("div",{style:{color:"#ccc"}},e("No authentication methods available."));var f=n.map(function(n){var r=t[n.authType];if(!!r){var a="".concat(e("Sign-in")," (").concat(p.Schema.compile(n.authTypeTitle||n.authType,{t:e}),")");return 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,a,o;r=e,a=t,o=n[t],a in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o})}return e}({component:(0,i.createElement)(r,{authenticator:n}),tabTitle:n.title||a},n)}}).filter(function(e){return e});return u().createElement(o.Space,{direction:"vertical",className:(0,r.css)(b())},f.length>1?u().createElement(o.Tabs,{items:f.map(function(e){return{label:e.tabTitle,key:e.name,children:e.component}})}):f.length?u().createElement("div",null,f[0].component):u().createElement(u().Fragment,null),u().createElement(o.Space,{direction:"vertical",className:(0,r.css)(S())},l))};function T(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 x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,u=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){u=!0,r=e}finally{try{!i&&null!=a.return&&a.return()}finally{if(u)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return T(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 T(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=(0,i.createContext)({});O.displayName="SignupPageContext";var j=function(e){var t=(0,i.useContext)(O);return t[e.authType]={component:e.component},u().createElement(O.Provider,{value:t},e.children)},A=function(){var e=(0,a.usePlugin)(v.default).authTypes.getEntities(),t={},n=!0,r=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done);n=!0){var l,c=x(i.value,2),f=c[0],s=c[1];(null===(l=s.components)||void 0===l?void 0:l.SignUpForm)&&(t[f]=s.components.SignUpForm)}}catch(e){r=!0,o=e}finally{try{!n&&null!=u.return&&u.return()}finally{if(r)throw o}}return t},I=function(){(0,a.useViewport)(),(0,a.useCurrentDocumentTitle)("Signup");var e=A(),t=x((0,l.useSearchParams)(),1)[0].get("name"),n=((0,c.u)(t)||{}).authType;return e[n]?(0,i.createElement)(e[n],{authenticatorName:t}):u().createElement(l.Navigate,{to:"/not-found",replace:!0})}}}]);
@@ -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
+ "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}))}}}]);
@@ -14,7 +14,7 @@ declare const AuthenticatorsContextProvider: import("react").LazyExoticComponent
14
14
  }> | typeof import("./pages").AuthLayout>, ExportAuthLayout: import("react").LazyExoticComponent<import("react").FC<{
15
15
  children: import("react").ReactNode;
16
16
  }> | typeof import("./pages").AuthLayout>;
17
- export { AuthenticatorsContextProvider, ExportAuthLayout as AuthLayout };
17
+ export { ExportAuthLayout as AuthLayout, AuthenticatorsContextProvider };
18
18
  export type AuthOptions = {
19
19
  components: Partial<{
20
20
  SignInForm: ComponentType<{
@@ -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("react-i18next"),require("@formily/antd-v5"),require("@formily/shared"),require("@nocobase/utils/client"),require("@nocobase/client"),require("antd"),require("@ant-design/icons"),require("@formily/react"),require("react-router-dom"),require("react"),require("@emotion/css")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth",["react-i18next","@formily/antd-v5","@formily/shared","@nocobase/utils/client","@nocobase/client","antd","@ant-design/icons","@formily/react","react-router-dom","react","@emotion/css"],e):"object"==typeof exports?exports["@nocobase/plugin-auth"]=e(require("react-i18next"),require("@formily/antd-v5"),require("@formily/shared"),require("@nocobase/utils/client"),require("@nocobase/client"),require("antd"),require("@ant-design/icons"),require("@formily/react"),require("react-router-dom"),require("react"),require("@emotion/css")):t["@nocobase/plugin-auth"]=e(t["react-i18next"],t["@formily/antd-v5"],t["@formily/shared"],t["@nocobase/utils/client"],t["@nocobase/client"],t.antd,t["@ant-design/icons"],t["@formily/react"],t["react-router-dom"],t.react,t["@emotion/css"])}(self,function(t,e,n,r,o,i,u,c,a,s,f){return function(){var l,p,d,h,b,y,m={437:function(t,e,n){"use strict";n.r(e),n.d(e,{AuthLayout:function(){return j},useSignIn:function(){return O},PluginAuthClient:function(){return q},AuthenticatorsContextProvider:function(){return k},default:function(){return C},AuthenticatorsContext:function(){return u.H},useAuthenticator:function(){return u.u}});var r=n("772"),o=n("584"),i=n("573"),u=n("308"),c=n(581);function a(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 s(t,e,n){return(s=h()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&p(o,n.prototype),o}).apply(null,arguments)}function f(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 l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t){var e="function"==typeof Map?new Map:void 0;return(d=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 s(t,arguments,l(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,t)})(t)}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(h=function(){return!!t})()}var b=(0,r.lazy)(function(){return c("imported_gs6osn_component",n.e("890").then(n.bind(n,387)))},"AuthProvider").AuthProvider,y=(0,r.lazy)(function(){return c("imported_kl5khg_component",n.e("938").then(n.bind(n,510)))},"Options","SignInForm","SignUpForm"),m=y.Options,g=y.SignInForm,v=y.SignUpForm,_=(0,r.lazy)(function(){return c("imported_-1ja1ffa_component",n.e("280").then(n.bind(n,492)))},"AuthLayout","SignInPage","SignUpPage"),x=_.AuthLayout,w=_.SignInPage,S=_.SignUpPage,P=(0,r.lazy)(function(){return c("imported_10vpsc8_component",n.e("851").then(n.bind(n,264)))},"Authenticator").Authenticator,A=(0,r.lazy)(function(){return c("imported_-1ja1ffa_component",n.e("280").then(n.bind(n,492)))},"AuthenticatorsContextProvider","AuthLayout"),k=A.AuthenticatorsContextProvider,j=A.AuthLayout,q=function(t){var e,n,r;function u(){var t,e,n,r,i,c,a;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,u),e=this,n=u,r=arguments,n=l(n),i=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,h()?Reflect.construct(n,r||[],l(e).constructor):n.apply(e,r)),c="authTypes",a=new o.Registry,c in i?Object.defineProperty(i,c,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[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&&p(t,e)}(u,t),e=u,n=[{key:"registerType",value:function(t,e){this.authTypes.register(t,e)}},{key:"load",value:function(){var t,e=this;return(t=function(){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(t){return e.app.pluginSettingsManager.add(i.A7,{icon:"LoginOutlined",title:'{{t("Authentication", { ns: "'.concat(i.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:x,SignInPage:w,SignUpPage:S}),e.app.providers.unshift([b,{}]),e.registerType("Email/Password",{components:{SignInForm:g,SignUpForm:v,AdminSettingsForm:m}}),[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){a(i,r,o,u,c,"next",t)}function c(t){a(i,r,o,u,c,"throw",t)}u(void 0)})})()}}],f(e.prototype,n),u}(d(r.Plugin)),O=function(t){return(0,r.useLazy)(function(){return c("imported_kl5khg_component",n.e("938").then(n.bind(n,510)))},"useSignIn")(t)},C=q},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"})}},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=u},964:function(t){"use strict";t.exports=f},632:function(t){"use strict";t.exports=e},505:function(t){"use strict";t.exports=c},875:function(t){"use strict";t.exports=n},772:function(t){"use strict";t.exports=o},584:function(t){"use strict";t.exports=r},721:function(t){"use strict";t.exports=i},156:function(t){"use strict";t.exports=s},238:function(e){"use strict";e.exports=t},128:function(t){"use strict";t.exports=a}},g={};function v(t){var e=g[t];if(void 0!==e)return e.exports;var n=g[t]={exports:{}};return m[t](n,n.exports,v),n.exports}return v.m=m,v.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return v.d(e,{a:e}),e},v.d=function(t,e){for(var n in e)v.o(e,n)&&!v.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},v.f={},v.e=function(t){return Promise.all(Object.keys(v.f).reduce(function(e,n){return v.f[n](t,e),e},[]))},v.u=function(t){return""+({280:"6992b2fd9b0275b1",851:"1c5e32ff8bef5e4a",890:"43e9587ca4936ffe",938:"0091d4359312cb07"})[t]+".js"},v.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),v.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},l={},p="@nocobase/plugin-auth:",v.l=function(t,e,n,r){if(l[t]){l[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")==p+n){o=a;break}}}!o&&(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,v.nc&&o.setAttribute("nonce",v.nc),o.setAttribute("data-webpack",p+n),o.src=t),l[t]=[e];var s=function(e,n){o.onerror=o.onload=null,clearTimeout(f);var r=l[t];if(delete l[t],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(t){return t(n)}),e)return e(n)},f=setTimeout(s.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=s.bind(null,o.onerror),o.onload=s.bind(null,o.onload),i&&document.head.appendChild(o)},v.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},v.p=(!(d=window.__nocobase_public_path__||"/").endsWith("/")&&(d+="/"),d+"static/plugins/@nocobase/plugin-auth/dist/client/"),h={909:0},v.f.j=function(t,e){var n=v.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=v.p+v.u(t),i=Error();v.l(o,function(e){if(v.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)v.o(r,i)&&(v.m[i]=r[i]);o&&o(v)}for(t&&t(e);c<n.length;c++)u=n[c],v.o(h,u)&&h[u]&&h[u][0](),h[u]=0},(y=self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).forEach(b.bind(null,0)),y.push=b.bind(null,y.push.bind(y)),v("437")}()});
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,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 I},useSignIn:function(){return M},PluginAuthClient:function(){return L},AuthenticatorsContextProvider:function(){return E},default:function(){return F},AuthenticatorsContext:function(){return s.H},useAuthenticator:function(){return s.u}});var r=n("772"),o=n("584"),i=n("741"),u=n.n(i),a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";return t.join(e).replace(RegExp(e+"{1,}","g"),e)},c=u()(function(t){t()},3e3,{leading:!0,trailing:!1}),f=n("573"),s=n("308"),l=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=g()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&v(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 b(t){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e){return(v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t){var e="function"==typeof Map?new Map:void 0;return(m=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,b(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),v(r,t)})(t)}function g(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(g=function(){return!!t})()}var x=(0,r.lazy)(function(){return l("imported_gs6osn_component",n.e("890").then(n.bind(n,387)))},"AuthProvider").AuthProvider,_=(0,r.lazy)(function(){return l("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 l("imported_-1ja1ffa_component",n.e("280").then(n.bind(n,492)))},"AuthLayout","SignInPage","SignUpPage"),O=A.AuthLayout,k=A.SignInPage,P=A.SignUpPage,T=(0,r.lazy)(function(){return l("imported_10vpsc8_component",n.e("851").then(n.bind(n,264)))},"Authenticator").Authenticator,q=(0,r.lazy)(function(){return l("imported_-1q5gcq5_component",n.e("104").then(n.bind(n,349)))},"TokenPolicySettings").TokenPolicySettings,C=(0,r.lazy)(function(){return l("imported_-1ja1ffa_component",n.e("280").then(n.bind(n,492)))},"AuthenticatorsContextProvider","AuthLayout"),E=C.AuthenticatorsContextProvider,I=C.AuthLayout,L=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=b(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,g()?Reflect.construct(n,r||[],b(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&&v(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,s;return e.app.pluginSettingsManager.add(f.A7,{icon:"LoginOutlined",title:'{{t("Authentication", { ns: "'.concat(f.A7,'" })}}'),Component:T,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:P}),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:q,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){var n,r,o=null==t?void 0:null===(r=t.response)||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:n.errors,u=Array.isArray(o)?o[0]:null;if(!u)throw t;if((null==u?void 0:u.code)==="USER_HAS_NO_ROLES_ERR")throw i.error=u,t;var f=i.router.state.location,s=f.pathname,l=f.search,p=i.router.basename;if(s!==i.getHref("signin")){var d=s.startsWith(i.router.basename)?s.slice(p.length)||"/":s,y=a([i.router.basename,d]);c(function(){i.apiClient.auth.setToken(null),i.router.navigate("/signin?redirect=".concat(y).concat(l),{replace:!0})})}}throw t}]),s=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,s)||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){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}(m(r.Plugin)),M=function(t){return(0,r.useLazy)(function(){return l("imported_kl5khg_component",n.e("938").then(n.bind(n,510)))},"useSignIn")(t)},F=L},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,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=c,r=f;return c=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?a(i,s-r):i))}function _(t){return(p=void 0,v&&c)?m(t):(c=f=void 0,l)}function S(){var t,n=o(),r=g(n);if(c=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,c=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,a=/^[-+]0x[0-9a-f]+$/i,c=/^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=c.test(t);return n||f.test(t)?s(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=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"),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(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,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},(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")}()});
@@ -0,0 +1,13 @@
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
+ import { Application } from '@nocobase/client';
10
+ import type { AxiosResponse } from 'axios';
11
+ export declare function authCheckMiddleware({ app }: {
12
+ app: Application;
13
+ }): ((res: AxiosResponse) => AxiosResponse<any, any>)[];
@@ -0,0 +1,15 @@
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
+ import React from 'react';
10
+ export declare const componentsNameMap: {
11
+ InputTime: string;
12
+ };
13
+ export declare const componentsMap: {
14
+ [x: string]: React.ForwardRefExoticComponent<Omit<Partial<any>, "ref"> & React.RefAttributes<unknown>>;
15
+ };
@@ -0,0 +1,24 @@
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
+ export declare const useSubmitActionProps: () => {
10
+ type: string;
11
+ onClick(): Promise<void>;
12
+ };
13
+ export declare const hooksNameMap: {
14
+ useSubmitActionProps: string;
15
+ useEditForm: string;
16
+ };
17
+ export declare const hooksMap: {
18
+ [x: string]: (() => {
19
+ form: import("@formily/core").Form<any>;
20
+ }) | (() => {
21
+ type: string;
22
+ onClick(): Promise<void>;
23
+ });
24
+ };
@@ -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
+ import React from 'react';
10
+ export declare const TokenPolicySettings: () => React.JSX.Element;
@@ -0,0 +1,12 @@
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
+ export declare const tokenPolicyRecordKey = "token-policy-config";
10
+ export declare const tokenPolicyCacheKey: string;
11
+ export declare const tokenPolicyCollectionName = "tokenControlConfig";
12
+ export declare const issuedTokensCollectionName = "issuedTokens";
@@ -0,0 +1,45 @@
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
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var constants_exports = {};
28
+ __export(constants_exports, {
29
+ issuedTokensCollectionName: () => issuedTokensCollectionName,
30
+ tokenPolicyCacheKey: () => tokenPolicyCacheKey,
31
+ tokenPolicyCollectionName: () => tokenPolicyCollectionName,
32
+ tokenPolicyRecordKey: () => tokenPolicyRecordKey
33
+ });
34
+ module.exports = __toCommonJS(constants_exports);
35
+ const tokenPolicyRecordKey = "token-policy-config";
36
+ const tokenPolicyCacheKey = "auth:" + tokenPolicyRecordKey;
37
+ const tokenPolicyCollectionName = "tokenControlConfig";
38
+ const issuedTokensCollectionName = "issuedTokens";
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ issuedTokensCollectionName,
42
+ tokenPolicyCacheKey,
43
+ tokenPolicyCollectionName,
44
+ tokenPolicyRecordKey
45
+ });
@@ -8,15 +8,17 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.6.0-alpha.14",
11
+ "@nocobase/client": "1.6.0-alpha.16",
12
12
  "react": "18.2.0",
13
- "@nocobase/utils": "1.6.0-alpha.14",
14
- "@nocobase/auth": "1.6.0-alpha.14",
15
- "@nocobase/database": "1.6.0-alpha.14",
13
+ "@nocobase/utils": "1.6.0-alpha.16",
14
+ "axios": "1.7.7",
16
15
  "lodash": "4.17.21",
17
- "@nocobase/cache": "1.6.0-alpha.14",
18
- "@nocobase/server": "1.6.0-alpha.14",
19
- "@nocobase/test": "1.6.0-alpha.14",
16
+ "@nocobase/auth": "1.6.0-alpha.16",
17
+ "@nocobase/database": "1.6.0-alpha.16",
18
+ "@nocobase/cache": "1.6.0-alpha.16",
19
+ "@nocobase/server": "1.6.0-alpha.16",
20
+ "@nocobase/logger": "1.6.0-alpha.16",
21
+ "@nocobase/test": "1.6.0-alpha.16",
20
22
  "@formily/antd-v5": "1.1.9",
21
23
  "antd": "5.12.8",
22
24
  "@formily/shared": "2.3.2",
@@ -25,5 +27,6 @@ module.exports = {
25
27
  "react-i18next": "11.18.6",
26
28
  "@emotion/css": "11.13.0",
27
29
  "@ant-design/icons": "5.2.6",
28
- "@nocobase/actions": "1.6.0-alpha.14"
30
+ "@nocobase/actions": "1.6.0-alpha.16",
31
+ "@formily/core": "2.3.0"
29
32
  };
@@ -29,5 +29,21 @@
29
29
  "Sign up settings": "Sign up settings",
30
30
  "Sign up form": "Sign up form",
31
31
  "At least one of the username or email fields is required": "At least one of the username or email fields is required",
32
- "Password is not allowed to be changed": "Password is not allowed to be changed"
32
+ "Password is not allowed to be changed": "Password is not allowed to be changed",
33
+ "Token policy": "Token policy",
34
+ "Token validity period": "Token validity period",
35
+ "Session validity": "Session validity",
36
+ "Expired token refresh limit": "Expired token refresh limit",
37
+ "Enable operation timeout control": "Enable operation timeout control",
38
+ "Seconds": "Seconds",
39
+ "Minutes": "Minutes",
40
+ "Hours": "Hours",
41
+ "Days": "Days",
42
+ "Saved successfully!": "Saved successfully!",
43
+ "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.": "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.",
44
+ "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)": "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)",
45
+ "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.": "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.",
46
+ "In configuration mode, the entire column becomes transparent. In non-configuration mode, the entire column will be hidden. Even if the entire column is hidden, its configured default values and other settings will still take effect.": "In configuration mode, the entire column becomes transparent. In non-configuration mode, the entire column will be hidden. Even if the entire column is hidden, its configured default values and other settings will still take effect.",
47
+ "Your session has expired. Please sign in again.": "Your session has expired. Please sign in again.",
48
+ "Unauthenticated. Please sign in to continue.": "Unauthenticated. Please sign in to continue."
33
49
  }
@@ -29,5 +29,20 @@
29
29
  "Sign up settings": "注册设置",
30
30
  "Sign up form": "注册表单",
31
31
  "At least one of the username or email fields is required": "至少需要设置用户名或邮箱中的一个字段为必填字段",
32
- "Password is not allowed to be changed": "密码不允许修改"
32
+ "Password is not allowed to be changed": "密码不允许修改",
33
+ "Token policy": "Token 策略",
34
+ "Token validity period": "Token 有效周期",
35
+ "Session validity": "会话有效期",
36
+ "Expired token refresh limit": "过期 Token 刷新时限",
37
+ "Enable operation timeout control": "启用操作超时控制",
38
+ "Seconds": "秒",
39
+ "Minutes": "分钟",
40
+ "Hours": "小时",
41
+ "Days": "天",
42
+ "Saved successfully!": "保存成功!",
43
+ "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.": "用户每次登录的最长有效时间,在会话有效期内,Token 会自动更新,超时后要求用户重新登录。",
44
+ "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)": "每次签发的 API Token 的有效期。Token 过期后,如果处于会话有效期内,并且没有超过刷新时限,服务端将自动签发新 Token 以保持用户会话,否则要求用户重新登录。(每个 Token 只能被刷新一次)",
45
+ "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.": "Token 过期后允许刷新的最大时限,超过此时限后,Token 无法自动更新,用户需重新登录。",
46
+ "Your session has expired. Please sign in again.": "您的会话已过期,请重新登录。",
47
+ "Unauthenticated. Please sign in to continue.": "未认证。请登录以继续。"
33
48
  }
@@ -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-01-14T06:06:38.324Z"}
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-01-19T06:31:53.112Z"}
@@ -0,0 +1 @@
1
+ (function(){var e={900:function(e){var r=1e3;var s=r*60;var a=s*60;var n=a*24;var t=n*7;var u=n*365.25;e.exports=function(e,r){r=r||{};var s=typeof e;if(s==="string"&&e.length>0){return parse(e)}else if(s==="number"&&isFinite(e)){return r.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var c=/^(-?(?:\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(!c){return}var i=parseFloat(c[1]);var o=(c[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return i*u;case"weeks":case"week":case"w":return i*t;case"days":case"day":case"d":return i*n;case"hours":case"hour":case"hrs":case"hr":case"h":return i*a;case"minutes":case"minute":case"mins":case"min":case"m":return i*s;case"seconds":case"second":case"secs":case"sec":case"s":return i*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return undefined}}function fmtShort(e){var t=Math.abs(e);if(t>=n){return Math.round(e/n)+"d"}if(t>=a){return Math.round(e/a)+"h"}if(t>=s){return Math.round(e/s)+"m"}if(t>=r){return Math.round(e/r)+"s"}return e+"ms"}function fmtLong(e){var t=Math.abs(e);if(t>=n){return plural(e,t,n,"day")}if(t>=a){return plural(e,t,a,"hour")}if(t>=s){return plural(e,t,s,"minute")}if(t>=r){return plural(e,t,r,"second")}return e+" ms"}function plural(e,r,s,a){var n=r>=s*1.5;return Math.round(e/s)+" "+a+(n?"s":"")}}};var r={};function __nccwpck_require__(s){var a=r[s];if(a!==undefined){return a.exports}var n=r[s]={exports:{}};var t=true;try{e[s](n,n.exports,__nccwpck_require__);t=false}finally{if(t)delete r[s]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var s=__nccwpck_require__(900);module.exports=s})();
@@ -0,0 +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-01-19T06:31:53.201Z"}
@@ -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
+ declare const _default: import("@nocobase/database").CollectionOptions;
10
+ export default _default;
@@ -0,0 +1,69 @@
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
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var issued_tokens_exports = {};
28
+ __export(issued_tokens_exports, {
29
+ default: () => issued_tokens_default
30
+ });
31
+ module.exports = __toCommonJS(issued_tokens_exports);
32
+ var import_database = require("@nocobase/database");
33
+ var import_constants = require("../../constants");
34
+ var issued_tokens_default = (0, import_database.defineCollection)({
35
+ name: import_constants.issuedTokensCollectionName,
36
+ autoGenId: false,
37
+ createdAt: true,
38
+ updatedAt: true,
39
+ fields: [
40
+ {
41
+ name: "id",
42
+ type: "uuid",
43
+ primaryKey: true,
44
+ allowNull: false,
45
+ interface: "input"
46
+ },
47
+ {
48
+ type: "bigInt",
49
+ name: "signInTime",
50
+ allowNull: false
51
+ },
52
+ {
53
+ name: "jti",
54
+ type: "uuid",
55
+ allowNull: false,
56
+ index: true
57
+ },
58
+ {
59
+ type: "bigInt",
60
+ name: "issuedTime",
61
+ allowNull: false
62
+ },
63
+ {
64
+ type: "bigInt",
65
+ name: "userId",
66
+ allowNull: false
67
+ }
68
+ ]
69
+ });
@@ -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
+ declare const _default: import("@nocobase/database").CollectionOptions;
10
+ export default _default;
@@ -0,0 +1,56 @@
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
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var token_poilcy_config_exports = {};
28
+ __export(token_poilcy_config_exports, {
29
+ default: () => token_poilcy_config_default
30
+ });
31
+ module.exports = __toCommonJS(token_poilcy_config_exports);
32
+ var import_database = require("@nocobase/database");
33
+ var import_constants = require("../../constants");
34
+ var token_poilcy_config_default = (0, import_database.defineCollection)({
35
+ name: import_constants.tokenPolicyCollectionName,
36
+ autoGenId: false,
37
+ createdAt: true,
38
+ createdBy: true,
39
+ updatedAt: true,
40
+ updatedBy: true,
41
+ fields: [
42
+ {
43
+ name: "key",
44
+ type: "string",
45
+ primaryKey: true,
46
+ allowNull: false,
47
+ interface: "input"
48
+ },
49
+ {
50
+ type: "json",
51
+ name: "config",
52
+ allowNull: false,
53
+ defaultValue: {}
54
+ }
55
+ ]
56
+ });
@@ -10,3 +10,4 @@ export { BasicAuth } from './basic-auth';
10
10
  export { AuthModel } from './model/authenticator';
11
11
  export { presetAuthType } from '../preset';
12
12
  export { default } from './plugin';
13
+ export * from '../constants';
@@ -25,6 +25,7 @@ var __copyProps = (to, from, except, desc) => {
25
25
  }
26
26
  return to;
27
27
  };
28
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
28
29
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
30
  // If the importer is in node compatibility mode or this is not an ESM
30
31
  // file that has been converted to a CommonJS file using a Babel-
@@ -46,9 +47,11 @@ var import_basic_auth = require("./basic-auth");
46
47
  var import_authenticator = require("./model/authenticator");
47
48
  var import_preset = require("../preset");
48
49
  var import_plugin = __toESM(require("./plugin"));
50
+ __reExport(server_exports, require("../constants"), module.exports);
49
51
  // Annotate the CommonJS export names for ESM import in node:
50
52
  0 && (module.exports = {
51
53
  AuthModel,
52
54
  BasicAuth,
53
- presetAuthType
55
+ presetAuthType,
56
+ ...require("../constants")
54
57
  });
@@ -0,0 +1,14 @@
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
+ import { Migration } from '@nocobase/server';
10
+ export default class extends Migration {
11
+ on: string;
12
+ appVersion: string;
13
+ up(): Promise<void>;
14
+ }
@@ -0,0 +1,58 @@
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
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var create_token_policy_config_exports = {};
28
+ __export(create_token_policy_config_exports, {
29
+ default: () => create_token_policy_config_default
30
+ });
31
+ module.exports = __toCommonJS(create_token_policy_config_exports);
32
+ var import_server = require("@nocobase/server");
33
+ var import_constants = require("../../constants");
34
+ class create_token_policy_config_default extends import_server.Migration {
35
+ on = "afterLoad";
36
+ // 'beforeLoad' or 'afterLoad'
37
+ appVersion = "<1.6.1";
38
+ async up() {
39
+ const tokenPolicyRepo = this.app.db.getRepository(import_constants.tokenPolicyCollectionName);
40
+ const tokenPolicy = await tokenPolicyRepo.findOne({ filterByTk: import_constants.tokenPolicyRecordKey });
41
+ if (tokenPolicy) {
42
+ this.app.authManager.tokenController.setConfig(tokenPolicy.config);
43
+ } else {
44
+ const config = {
45
+ tokenExpirationTime: "1d",
46
+ sessionExpirationTime: "7d",
47
+ expiredTokenRenewLimit: "1d"
48
+ };
49
+ await tokenPolicyRepo.create({
50
+ values: {
51
+ key: import_constants.tokenPolicyRecordKey,
52
+ config
53
+ }
54
+ });
55
+ this.app.authManager.tokenController.setConfig(config);
56
+ }
57
+ }
58
+ }
@@ -49,9 +49,31 @@ var import_basic_auth = require("./basic-auth");
49
49
  var import_authenticator = require("./model/authenticator");
50
50
  var import_storer = require("./storer");
51
51
  var import_token_blacklist = require("./token-blacklist");
52
+ var import_token_controller = require("./token-controller");
53
+ var import_constants = require("../constants");
52
54
  class PluginAuthServer extends import_server.Plugin {
53
55
  cache;
54
56
  afterAdd() {
57
+ this.app.on("afterLoad", async () => {
58
+ if (this.app.authManager.tokenController) {
59
+ return;
60
+ }
61
+ const cache = await this.app.cacheManager.createCache({
62
+ name: "auth-token-controller",
63
+ prefix: "auth-token-controller"
64
+ });
65
+ const tokenController = new import_token_controller.TokenController({ cache, app: this.app, logger: this.app.log });
66
+ this.app.authManager.setTokenControlService(tokenController);
67
+ const tokenPolicyRepo = this.app.db.getRepository(import_constants.tokenPolicyCollectionName);
68
+ try {
69
+ const res = await tokenPolicyRepo.findOne({ filterByTk: import_constants.tokenPolicyRecordKey });
70
+ if (res) {
71
+ this.app.authManager.tokenController.setConfig(res.config);
72
+ }
73
+ } catch (error) {
74
+ this.app.logger.warn("access control config not exist, use default value");
75
+ }
76
+ });
55
77
  }
56
78
  async beforeLoad() {
57
79
  this.app.db.registerModels({ AuthModel: import_authenticator.AuthModel });
@@ -111,8 +133,8 @@ class PluginAuthServer extends import_server.Plugin {
111
133
  Object.entries(import_authenticators.default).forEach(
112
134
  ([action, handler]) => this.app.resourceManager.registerActionHandler(`authenticators:${action}`, handler)
113
135
  );
114
- ["check", "signIn", "signUp"].forEach((action) => this.app.acl.allow("auth", action));
115
- ["signOut", "changePassword"].forEach((action) => this.app.acl.allow("auth", action, "loggedIn"));
136
+ ["signIn", "signUp"].forEach((action) => this.app.acl.allow("auth", action));
137
+ ["check", "signOut", "changePassword"].forEach((action) => this.app.acl.allow("auth", action, "loggedIn"));
116
138
  this.app.acl.allow("authenticators", "publicList");
117
139
  this.app.acl.registerSnippet({
118
140
  name: `pm.${this.name}.authenticators`,
@@ -144,14 +166,18 @@ class PluginAuthServer extends import_server.Plugin {
144
166
  cache: this.app.cache,
145
167
  logger: this.app.logger
146
168
  });
147
- const user = await auth.check();
148
- if (!user) {
149
- this.app.logger.error(`Invalid token: ${payload.token}`);
150
- this.app.emit(`ws:removeTag`, {
151
- clientId,
152
- tagKey: "userId"
153
- });
154
- return;
169
+ let user;
170
+ try {
171
+ user = await auth.check();
172
+ } catch (error) {
173
+ if (!user) {
174
+ this.app.logger.error(error);
175
+ this.app.emit(`ws:removeTag`, {
176
+ clientId,
177
+ tagKey: "userId"
178
+ });
179
+ return;
180
+ }
155
181
  }
156
182
  this.app.emit(`ws:setTag`, {
157
183
  clientId,
@@ -252,24 +278,47 @@ class PluginAuthServer extends import_server.Plugin {
252
278
  },
253
279
  "auth:signOut"
254
280
  ]);
281
+ this.app.acl.registerSnippet({
282
+ name: `pm.security.token-policy`,
283
+ actions: [`${import_constants.tokenPolicyCollectionName}:*`]
284
+ });
285
+ this.app.db.on(`${import_constants.tokenPolicyCollectionName}.afterSave`, async (model) => {
286
+ var _a;
287
+ (_a = this.app.authManager.tokenController) == null ? void 0 : _a.setConfig(model.config);
288
+ });
255
289
  }
256
290
  async install(options) {
257
- const repository = this.db.getRepository("authenticators");
258
- const exist = await repository.findOne({ filter: { name: import_preset.presetAuthenticator } });
259
- if (exist) {
291
+ const authRepository = this.db.getRepository("authenticators");
292
+ const exist = await authRepository.findOne({ filter: { name: import_preset.presetAuthenticator } });
293
+ if (!exist) {
294
+ await authRepository.create({
295
+ values: {
296
+ name: import_preset.presetAuthenticator,
297
+ authType: import_preset.presetAuthType,
298
+ description: "Sign in with username/email.",
299
+ enabled: true,
300
+ options: {
301
+ public: {
302
+ allowSignUp: true
303
+ }
304
+ }
305
+ }
306
+ });
307
+ }
308
+ const tokenPolicyRepo = this.app.db.getRepository(import_constants.tokenPolicyCollectionName);
309
+ const res = await tokenPolicyRepo.findOne({ filterByTk: import_constants.tokenPolicyRecordKey });
310
+ if (res) {
260
311
  return;
261
312
  }
262
- await repository.create({
313
+ const config = {
314
+ tokenExpirationTime: "1d",
315
+ sessionExpirationTime: "7d",
316
+ expiredTokenRenewLimit: "1d"
317
+ };
318
+ await tokenPolicyRepo.create({
263
319
  values: {
264
- name: import_preset.presetAuthenticator,
265
- authType: import_preset.presetAuthType,
266
- description: "Sign in with username/email.",
267
- enabled: true,
268
- options: {
269
- public: {
270
- allowSignUp: true
271
- }
272
- }
320
+ key: import_constants.tokenPolicyRecordKey,
321
+ config
273
322
  }
274
323
  });
275
324
  }
@@ -0,0 +1,40 @@
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
+ import { ITokenControlService, TokenPolicyConfig, NumericTokenPolicyConfig, TokenInfo } from '@nocobase/auth';
10
+ import type { SystemLogger } from '@nocobase/logger';
11
+ import { Cache } from '@nocobase/cache';
12
+ import Application from '@nocobase/server';
13
+ import Database from '@nocobase/database';
14
+ type TokenControlService = ITokenControlService;
15
+ export declare class TokenController implements TokenControlService {
16
+ cache: Cache;
17
+ app: Application;
18
+ db: Database;
19
+ logger: SystemLogger;
20
+ constructor({ cache, app, logger }: {
21
+ cache: Cache;
22
+ app: Application;
23
+ logger: SystemLogger;
24
+ });
25
+ setTokenInfo(id: string, value: TokenInfo): Promise<void>;
26
+ getConfig(): Promise<NumericTokenPolicyConfig>;
27
+ setConfig(config: TokenPolicyConfig): Promise<void>;
28
+ removeSessionExpiredTokens(userId: number): Promise<any>;
29
+ add({ userId }: {
30
+ userId: number;
31
+ }): Promise<{
32
+ jti: `${string}-${string}-${string}-${string}-${string}`;
33
+ issuedTime: number;
34
+ signInTime: number;
35
+ renewed: boolean;
36
+ userId: number;
37
+ }>;
38
+ renew: TokenControlService['renew'];
39
+ }
40
+ export {};
@@ -0,0 +1,161 @@
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
+ var __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+ var token_controller_exports = {};
38
+ __export(token_controller_exports, {
39
+ TokenController: () => TokenController
40
+ });
41
+ module.exports = __toCommonJS(token_controller_exports);
42
+ var import_auth = require("@nocobase/auth");
43
+ var import_crypto = require("crypto");
44
+ var import_ms = __toESM(require("ms"));
45
+ var import_constants = require("../constants");
46
+ const JTICACHEKEY = "token-jti";
47
+ class TokenController {
48
+ cache;
49
+ app;
50
+ db;
51
+ logger;
52
+ constructor({ cache, app, logger }) {
53
+ this.cache = cache;
54
+ this.app = app;
55
+ this.logger = logger;
56
+ }
57
+ async setTokenInfo(id, value) {
58
+ const repo = this.app.db.getRepository(import_constants.issuedTokensCollectionName);
59
+ await repo.updateOrCreate({ filterKeys: ["id"], values: value });
60
+ await this.cache.set(`${JTICACHEKEY}:${id}`, value);
61
+ return;
62
+ }
63
+ getConfig() {
64
+ return this.cache.wrap("config", async () => {
65
+ const repo = this.app.db.getRepository(import_constants.tokenPolicyCollectionName);
66
+ const configRecord = await repo.findOne({ filterByTk: import_constants.tokenPolicyRecordKey });
67
+ if (!configRecord) return null;
68
+ const config = configRecord.config;
69
+ return {
70
+ tokenExpirationTime: (0, import_ms.default)(config.tokenExpirationTime),
71
+ sessionExpirationTime: (0, import_ms.default)(config.sessionExpirationTime),
72
+ expiredTokenRenewLimit: (0, import_ms.default)(config.expiredTokenRenewLimit)
73
+ };
74
+ });
75
+ }
76
+ setConfig(config) {
77
+ return this.cache.set("config", {
78
+ tokenExpirationTime: (0, import_ms.default)(config.tokenExpirationTime),
79
+ sessionExpirationTime: (0, import_ms.default)(config.sessionExpirationTime),
80
+ expiredTokenRenewLimit: (0, import_ms.default)(config.expiredTokenRenewLimit)
81
+ });
82
+ }
83
+ async removeSessionExpiredTokens(userId) {
84
+ const config = await this.getConfig();
85
+ const issuedTokenRepo = this.app.db.getRepository(import_constants.issuedTokensCollectionName);
86
+ const currTS = Date.now();
87
+ return issuedTokenRepo.destroy({
88
+ filter: {
89
+ userId,
90
+ signInTime: {
91
+ $lt: currTS - config.sessionExpirationTime
92
+ }
93
+ }
94
+ });
95
+ }
96
+ async add({ userId }) {
97
+ const jti = (0, import_crypto.randomUUID)();
98
+ const currTS = Date.now();
99
+ const data = {
100
+ jti,
101
+ issuedTime: currTS,
102
+ signInTime: currTS,
103
+ renewed: false,
104
+ userId
105
+ };
106
+ await this.setTokenInfo(jti, data);
107
+ try {
108
+ if (process.env.DB_DIALECT === "sqlite") {
109
+ await this.removeSessionExpiredTokens(userId);
110
+ } else {
111
+ this.removeSessionExpiredTokens(userId);
112
+ }
113
+ } catch (err) {
114
+ this.logger.error(err, { module: "auth", submodule: "token-controller", method: "removeSessionExpiredTokens" });
115
+ }
116
+ return data;
117
+ }
118
+ renew = async (jti) => {
119
+ const repo = this.app.db.getRepository(import_constants.issuedTokensCollectionName);
120
+ const model = this.app.db.getModel(import_constants.issuedTokensCollectionName);
121
+ const exists = await repo.findOne({ filter: { jti } });
122
+ if (!exists) {
123
+ this.logger.error("jti not found", {
124
+ module: "auth",
125
+ submodule: "token-controller",
126
+ method: "renew",
127
+ jti,
128
+ code: import_auth.AuthErrorCode.TOKEN_RENEW_FAILED
129
+ });
130
+ throw new import_auth.AuthError({
131
+ message: "Your session has expired. Please sign in again.",
132
+ code: import_auth.AuthErrorCode.TOKEN_RENEW_FAILED
133
+ });
134
+ }
135
+ const newId = (0, import_crypto.randomUUID)();
136
+ const issuedTime = Date.now();
137
+ const [count] = await model.update(
138
+ { jti: newId, issuedTime },
139
+ { where: { jti } }
140
+ );
141
+ if (count === 1) {
142
+ return { jti: newId, issuedTime };
143
+ } else {
144
+ this.logger.error("jti renew failed", {
145
+ module: "auth",
146
+ submodule: "token-controller",
147
+ method: "renew",
148
+ jti,
149
+ code: import_auth.AuthErrorCode.TOKEN_RENEW_FAILED
150
+ });
151
+ throw new import_auth.AuthError({
152
+ message: "Your session has expired. Please sign in again.",
153
+ code: import_auth.AuthErrorCode.TOKEN_RENEW_FAILED
154
+ });
155
+ }
156
+ };
157
+ }
158
+ // Annotate the CommonJS export names for ESM import in node:
159
+ 0 && (module.exports = {
160
+ TokenController
161
+ });
@@ -0,0 +1,9 @@
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
+ export type { TokenPolicyConfig as TokenPolicyConfig } from '@nocobase/auth';
package/dist/types.js ADDED
@@ -0,0 +1,24 @@
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
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var types_exports = {};
24
+ module.exports = __toCommonJS(types_exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-auth",
3
- "version": "1.6.0-alpha.14",
3
+ "version": "1.6.0-alpha.16",
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",
@@ -11,6 +11,7 @@
11
11
  "@types/cron": "^2.0.1",
12
12
  "antd": "5.x",
13
13
  "cron": "^2.3.1",
14
+ "ms": "^2.1.3",
14
15
  "react": "^18.2.0",
15
16
  "react-i18next": "^11.15.1"
16
17
  },
@@ -26,8 +27,9 @@
26
27
  "displayName.zh-CN": "用户认证",
27
28
  "description": "User authentication management, including password, SMS, and support for Single Sign-On (SSO) protocols, with extensibility.",
28
29
  "description.zh-CN": "用户认证管理,包括基础的密码认证、短信认证、SSO 协议的认证等,可扩展。",
29
- "gitHead": "1bf7648d7cf62fadef4e31535b4907046a952b4a",
30
+ "gitHead": "08a58df92b68f7df5e93c5f7cf997b4e4fbc68b5",
30
31
  "keywords": [
31
- "Authentication"
32
+ "Authentication",
33
+ "Security"
32
34
  ]
33
35
  }