@nocobase/plugin-auth 1.6.0-alpha.5 → 1.6.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +8 -8
- package/dist/locale/en-US.json +2 -1
- package/dist/locale/zh-CN.json +2 -1
- package/dist/node_modules/cron/package.json +1 -1
- package/dist/server/actions/auth.js +6 -0
- package/dist/server/plugin.js +5 -37
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("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={437:function(t,e,n){"use strict";n.r(e),n.d(e,{AuthLayout:function(){return q},useSignIn:function(){return j},PluginAuthClient:function(){return O},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,S=_.SignInPage,P=_.SignUpPage,A=(0,r.lazy)(function(){return c("imported_10vpsc8_component",n.e("851").then(n.bind(n,264)))},"Authenticator").Authenticator,w=(0,r.lazy)(function(){return c("imported_-1ja1ffa_component",n.e("280").then(n.bind(n,492)))},"AuthenticatorsContextProvider","AuthLayout"),k=w.AuthenticatorsContextProvider,q=w.AuthLayout,O=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:A,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:S,SignUpPage:P}),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)),j=function(t){return(0,r.useLazy)(function(){return c("imported_kl5khg_component",n.e("938").then(n.bind(n,510)))},"useSignIn")(t)},C=O},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}},m={};function g(t){var e=m[t];if(void 0!==e)return e.exports;var n=m[t]={exports:{}};return y[t](n,n.exports,g),n.exports}return g.m=y,g.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return g.d(e,{a:e}),e},g.d=function(t,e){for(var n in e)g.o(e,n)&&!g.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},g.f={},g.e=function(t){return Promise.all(Object.keys(g.f).reduce(function(e,n){return g.f[n](t,e),e},[]))},g.u=function(t){return""+({280:"6992b2fd9b0275b1",851:"1c5e32ff8bef5e4a",890:"43e9587ca4936ffe",938:"0994a09f2c3ca18d"})[t]+".js"},g.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},l={},p="@nocobase/plugin-auth:",g.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,g.nc&&o.setAttribute("nonce",g.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)},g.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},g.p="/static/plugins/@nocobase/plugin-auth/dist/client/",d={909:0},g.f.j=function(t,e){var n=g.o(d,t)?d[t]:void 0;if(0!==n){if(n)e.push(n[2]);else{var r=new Promise(function(e,r){n=d[t]=[e,r]});e.push(n[2]=r);var o=g.p+g.u(t),i=Error();g.l(o,function(e){if(g.o(d,t)&&(0!==(n=d[t])&&(d[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)}}},h=function(t,e){var n=e[0],r=e[1],o=e[2],i,u,c=0;if(n.some(function(t){return 0!==d[t]})){for(i in r)g.o(r,i)&&(g.m[i]=r[i]);o&&o(g)}for(t&&t(e);c<n.length;c++)u=n[c],g.o(d,u)&&d[u]&&d[u][0](),d[u]=0},(b=self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).forEach(h.bind(null,0)),b.push=h.bind(null,b.push.bind(b)),g("437")}()});
|
|
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:"0994a09f2c3ca18d"})[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")}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.6.0-alpha.
|
|
11
|
+
"@nocobase/client": "1.6.0-alpha.7",
|
|
12
12
|
"react": "18.2.0",
|
|
13
|
-
"@nocobase/utils": "1.6.0-alpha.
|
|
14
|
-
"@nocobase/auth": "1.6.0-alpha.
|
|
15
|
-
"@nocobase/database": "1.6.0-alpha.
|
|
13
|
+
"@nocobase/utils": "1.6.0-alpha.7",
|
|
14
|
+
"@nocobase/auth": "1.6.0-alpha.7",
|
|
15
|
+
"@nocobase/database": "1.6.0-alpha.7",
|
|
16
16
|
"lodash": "4.17.21",
|
|
17
|
-
"@nocobase/cache": "1.6.0-alpha.
|
|
18
|
-
"@nocobase/server": "1.6.0-alpha.
|
|
19
|
-
"@nocobase/test": "1.6.0-alpha.
|
|
17
|
+
"@nocobase/cache": "1.6.0-alpha.7",
|
|
18
|
+
"@nocobase/server": "1.6.0-alpha.7",
|
|
19
|
+
"@nocobase/test": "1.6.0-alpha.7",
|
|
20
20
|
"@formily/antd-v5": "1.1.9",
|
|
21
21
|
"antd": "5.12.8",
|
|
22
22
|
"@formily/shared": "2.3.2",
|
|
@@ -25,5 +25,5 @@ module.exports = {
|
|
|
25
25
|
"react-i18next": "11.18.6",
|
|
26
26
|
"@emotion/css": "11.13.0",
|
|
27
27
|
"@ant-design/icons": "5.2.6",
|
|
28
|
-
"@nocobase/actions": "1.6.0-alpha.
|
|
28
|
+
"@nocobase/actions": "1.6.0-alpha.7"
|
|
29
29
|
};
|
package/dist/locale/en-US.json
CHANGED
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"Show": "Show",
|
|
29
29
|
"Sign up settings": "Sign up settings",
|
|
30
30
|
"Sign up form": "Sign up form",
|
|
31
|
-
"At least one of the username or email fields is required": "At least one of the username or email fields is required"
|
|
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
33
|
}
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"Show": "显示",
|
|
29
29
|
"Sign up settings": "注册设置",
|
|
30
30
|
"Sign up form": "注册表单",
|
|
31
|
-
"At least one of the username or email fields is required": "至少需要设置用户名或邮箱中的一个字段为必填字段"
|
|
31
|
+
"At least one of the username or email fields is required": "至少需要设置用户名或邮箱中的一个字段为必填字段",
|
|
32
|
+
"Password is not allowed to be changed": "密码不允许修改"
|
|
32
33
|
}
|
|
@@ -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":"2024-12-
|
|
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":"2024-12-24T16:53:50.033Z"}
|
|
@@ -45,6 +45,12 @@ var auth_default = {
|
|
|
45
45
|
// await next();
|
|
46
46
|
// },
|
|
47
47
|
changePassword: async (ctx, next) => {
|
|
48
|
+
const systemSettings = ctx.db.getRepository("systemSettings");
|
|
49
|
+
const settings = await systemSettings.findOne();
|
|
50
|
+
const enableChangePassword = settings.get("enableChangePassword");
|
|
51
|
+
if (enableChangePassword === false) {
|
|
52
|
+
ctx.throw(403, ctx.t("Password is not allowed to be changed", { ns: import_preset.namespace }));
|
|
53
|
+
}
|
|
48
54
|
const {
|
|
49
55
|
values: { oldPassword, newPassword, confirmPassword }
|
|
50
56
|
} = ctx.action.params;
|
package/dist/server/plugin.js
CHANGED
|
@@ -131,7 +131,7 @@ class PluginAuthServer extends import_server.Plugin {
|
|
|
131
131
|
{
|
|
132
132
|
name: "auth:signIn",
|
|
133
133
|
getMetaData: async (ctx) => {
|
|
134
|
-
var _a
|
|
134
|
+
var _a;
|
|
135
135
|
let body = {};
|
|
136
136
|
if (ctx.status === 200) {
|
|
137
137
|
body = {
|
|
@@ -145,20 +145,10 @@ class PluginAuthServer extends import_server.Plugin {
|
|
|
145
145
|
}
|
|
146
146
|
return {
|
|
147
147
|
request: {
|
|
148
|
-
params: (_a = ctx.request) == null ? void 0 : _a.params,
|
|
149
148
|
body: {
|
|
150
|
-
...(
|
|
149
|
+
...(_a = ctx.request) == null ? void 0 : _a.body,
|
|
151
150
|
password: void 0
|
|
152
|
-
},
|
|
153
|
-
path: (_c = ctx.request) == null ? void 0 : _c.path,
|
|
154
|
-
headers: {
|
|
155
|
-
"x-authenticator": (_d = ctx.request) == null ? void 0 : _d.headers["x-authenticator"],
|
|
156
|
-
"x-locale": (_e = ctx.request) == null ? void 0 : _e.headers["x-locale"],
|
|
157
|
-
"x-timezone": (_f = ctx.request) == null ? void 0 : _f.headers["x-timezone"]
|
|
158
151
|
}
|
|
159
|
-
},
|
|
160
|
-
response: {
|
|
161
|
-
body
|
|
162
152
|
}
|
|
163
153
|
};
|
|
164
154
|
},
|
|
@@ -193,26 +183,13 @@ class PluginAuthServer extends import_server.Plugin {
|
|
|
193
183
|
{
|
|
194
184
|
name: "auth:signUp",
|
|
195
185
|
getMetaData: async (ctx) => {
|
|
196
|
-
var _a
|
|
186
|
+
var _a;
|
|
197
187
|
return {
|
|
198
188
|
request: {
|
|
199
|
-
params: (_a = ctx.request) == null ? void 0 : _a.params,
|
|
200
189
|
body: {
|
|
201
|
-
...(
|
|
190
|
+
...(_a = ctx.request) == null ? void 0 : _a.body,
|
|
202
191
|
password: void 0,
|
|
203
192
|
confirm_password: void 0
|
|
204
|
-
},
|
|
205
|
-
path: (_c = ctx.request) == null ? void 0 : _c.path,
|
|
206
|
-
headers: {
|
|
207
|
-
"x-authenticator": (_d = ctx.request) == null ? void 0 : _d.headers["x-authenticator"],
|
|
208
|
-
"x-locale": (_e = ctx.request) == null ? void 0 : _e.headers["x-locale"],
|
|
209
|
-
"x-timezone": (_f = ctx.request) == null ? void 0 : _f.headers["x-timezone"]
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
response: {
|
|
213
|
-
body: {
|
|
214
|
-
...(_g = ctx.response) == null ? void 0 : _g.body,
|
|
215
|
-
token: void 0
|
|
216
193
|
}
|
|
217
194
|
}
|
|
218
195
|
};
|
|
@@ -221,18 +198,9 @@ class PluginAuthServer extends import_server.Plugin {
|
|
|
221
198
|
{
|
|
222
199
|
name: "auth:changePassword",
|
|
223
200
|
getMetaData: async (ctx) => {
|
|
224
|
-
var _a, _b, _c;
|
|
225
201
|
return {
|
|
226
202
|
request: {
|
|
227
|
-
|
|
228
|
-
query: ctx.request.query,
|
|
229
|
-
body: {},
|
|
230
|
-
path: ctx.request.path,
|
|
231
|
-
headers: {
|
|
232
|
-
"x-authenticator": (_a = ctx.request) == null ? void 0 : _a.headers["x-authenticator"],
|
|
233
|
-
"x-locale": (_b = ctx.request) == null ? void 0 : _b.headers["x-locale"],
|
|
234
|
-
"x-timezone": (_c = ctx.request) == null ? void 0 : _c.headers["x-timezone"]
|
|
235
|
-
}
|
|
203
|
+
body: {}
|
|
236
204
|
},
|
|
237
205
|
response: {
|
|
238
206
|
body: {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-auth",
|
|
3
|
-
"version": "1.6.0-alpha.
|
|
3
|
+
"version": "1.6.0-alpha.7",
|
|
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",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"displayName.zh-CN": "用户认证",
|
|
27
27
|
"description": "User authentication management, including password, SMS, and support for Single Sign-On (SSO) protocols, with extensibility.",
|
|
28
28
|
"description.zh-CN": "用户认证管理,包括基础的密码认证、短信认证、SSO 协议的认证等,可扩展。",
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "d9552440f5e3ce2795c9f2f23a1b04f5376a1550",
|
|
30
30
|
"keywords": [
|
|
31
31
|
"Authentication"
|
|
32
32
|
]
|