@nocobase/plugin-auth 0.20.0-alpha.9 → 0.21.0-alpha.2
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.d.ts
CHANGED
|
@@ -15,12 +15,12 @@ export type AuthOptions = {
|
|
|
15
15
|
AdminSettingsForm: ComponentType;
|
|
16
16
|
}>;
|
|
17
17
|
};
|
|
18
|
-
export declare class
|
|
18
|
+
export declare class PluginAuthClient extends Plugin {
|
|
19
19
|
authTypes: any;
|
|
20
20
|
registerType(authType: string, options: AuthOptions): void;
|
|
21
21
|
load(): Promise<void>;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
24
|
-
export { useSignIn } from './basic';
|
|
25
|
-
export { useAuthenticator, AuthenticatorsContext } from './authenticator';
|
|
23
|
+
export { AuthenticatorsContext, useAuthenticator } from './authenticator';
|
|
26
24
|
export type { Authenticator } from './authenticator';
|
|
25
|
+
export { useSignIn } from './basic';
|
|
26
|
+
export default PluginAuthClient;
|
package/dist/client/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(function(c,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("react"),require("react-router-dom"),require("react-i18next"),require("antd"),require("@formily/shared"),require("@ant-design/icons"),require("@formily/react"),require("@emotion/css"),require("@nocobase/utils/client")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","react","react-router-dom","react-i18next","antd","@formily/shared","@ant-design/icons","@formily/react","@emotion/css","@nocobase/utils/client"],e):(c=typeof globalThis!="undefined"?globalThis:c||self,e(c["@nocobase/plugin-auth"]={},c["@nocobase/client"],c.jsxRuntime,c.react,c["react-router-dom"],c["react-i18next"],c.antd,c["@formily/shared"],c["@ant-design/icons"],c["@formily/react"],c["@emotion/css"],c["@nocobase/utils"]))})(this,function(c,e,n,u,m,x,d,g,y,h,b,E){"use strict";var pe=Object.defineProperty,ue=Object.defineProperties;var le=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;var U=(c,e,n)=>e in c?pe(c,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):c[e]=n,C=(c,e)=>{for(var n in e||(e={}))me.call(e,n)&&U(c,n,e[n]);if(N)for(var n of N(e))de.call(e,n)&&U(c,n,e[n]);return c},T=(c,e)=>ue(c,le(e));var $=(c,e,n)=>(U(c,typeof e!="symbol"?e+"":e,n),n);var v=(c,e,n)=>new Promise((u,m)=>{var x=y=>{try{g(n.next(y))}catch(h){m(h)}},d=y=>{try{g(n.throw(y))}catch(h){m(h)}},g=y=>y.done?u(y.value):Promise.resolve(y.value).then(x,d);g((n=n.apply(c,e)).next())});const j=t=>{const r=m.useLocation(),o=e.useAPIClient();return u.useEffect(()=>{const i=new URLSearchParams(r.search),s=i.get("authenticator"),a=i.get("token");a&&(o.auth.setToken(a),o.auth.setAuthenticator(s))}),n.jsx(n.Fragment,{children:t.children})},F="auth";function A(){return x.useTranslation([F,"client"],{nsMode:"fallback"})}const w=u.createContext({type:""});w.displayName="AuthTypeContext";const P=u.createContext({types:[]});P.displayName="AuthTypesContext";const B=()=>{const{types:t}=u.useContext(P);return t},k={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":t=>/^[a-zA-Z0-9_-]+$/.test(t)?"":e.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"}}]},L={type:"object",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(t){const r=e.useActionContext(),{type:o}=u.useContext(w);return e.useRequest(()=>Promise.resolve({data:{name:`s_${g.uid()}`,authType:o}}),T(C({},t),{refreshDeps:[r.visible]}))}},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 }}"}}}}}}}},O={type:"void",name:"authenticators","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:k,resourceName:"authenticators",dragSort:!0,request:{resource:"authenticators",action:"list",params:{pageSize:50,sort:"sort",appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:k},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":{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(){const t=e.useAPIClient(),{t:r}=x.useTranslation();return{move(i,s){return v(this,null,function*(){yield t.resource("authenticators").move({sourceId:i.id,targetId:s.id}),d.message.success(r("Saved successfully"),.2)})}}}},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() }}"}}}}}}}}},V=t=>{const r=e.useRecord(),o=e.useRequest(()=>Promise.resolve({data:C({},r.options)}),T(C({},t),{manual:!0})),{run:i}=o,s=e.useActionContext();return u.useEffect(()=>{s.visible&&i()},[s.visible,i]),o},_=t=>{var i;const o=e.usePlugin(f).authTypes.get(t);return(i=o==null?void 0:o.components)==null?void 0:i.AdminSettingsForm},M=h.observer(()=>{const t=h.useForm(),r=e.useRecord(),o=_(t.values.authType||r.authType);return o?n.jsx(o,{}):null},{displayName:"Options"}),z=()=>{const{setVisible:t}=e.useActionContext();return{run(){return v(this,null,function*(){t(!1)})}}},Z=()=>{const{t}=x.useTranslation(),[r,o]=u.useState(!1),[i,s]=u.useState(""),a=B(),p=a.map(l=>T(C({},l),{onClick:()=>{o(!0),s(l.value)}}));return n.jsx(e.ActionContextProvider,{value:{visible:r,setVisible:o},children:n.jsxs(w.Provider,{value:{type:i},children:[n.jsx(d.Dropdown,{menu:{items:p},children:n.jsxs(d.Button,{icon:n.jsx(y.PlusOutlined,{}),type:"primary",children:[t("Add new")," ",n.jsx(y.DownOutlined,{})]})}),n.jsx(e.SchemaComponent,{scope:{useCloseAction:z,types:a,setType:s},schema:L})]})})},K=()=>(e.useAsyncData(),!1),W=()=>{const{t}=A(),[r,o]=u.useState([]),i=e.useAPIClient();return e.useRequest(()=>i.resource("authenticators").listTypes().then(s=>{var p;return(((p=s==null?void 0:s.data)==null?void 0:p.data)||[]).map(l=>({key:l.name,label:t(l.title||l.name),value:l.name}))}),{onSuccess:s=>{o(s)}}),n.jsx(d.Card,{bordered:!1,children:n.jsx(P.Provider,{value:{types:r},children:n.jsx(e.SchemaComponent,{schema:O,components:{AddNew:Z,Options:M},scope:{types:r,useValuesFromOptions:V,useCanNotDelete:K,t}})})})},S=u.createContext([]);S.displayName="AuthenticatorsContext";const I=t=>u.useContext(S).find(o=>o.name===t);function G(t){var a;const{data:r}=e.useSystemSettings(),o=e.useAPIClient(),{data:i=[],error:s}=e.useRequest(()=>o.resource("authenticators").publicList().then(p=>{var l;return((l=p==null?void 0:p.data)==null?void 0:l.data)||[]}));if(s)throw s;return n.jsxs("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh"},children:[n.jsx("h1",{children:(a=r==null?void 0:r.data)==null?void 0:a.title}),n.jsx(S.Provider,{value:i,children:n.jsx(m.Outlet,{})}),n.jsx("div",{className:b.css`
|
|
1
|
+
(function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("@nocobase/utils/client"),require("react/jsx-runtime"),require("react"),require("react-router-dom"),require("react-i18next"),require("@formily/react"),require("@emotion/css"),require("antd"),require("@formily/shared"),require("@ant-design/icons")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","@nocobase/utils/client","react/jsx-runtime","react","react-router-dom","react-i18next","@formily/react","@emotion/css","antd","@formily/shared","@ant-design/icons"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i["@nocobase/plugin-auth"]={},i["@nocobase/client"],i["@nocobase/utils"],i.jsxRuntime,i.react,i["react-router-dom"],i["react-i18next"],i["@formily/react"],i["@emotion/css"],i.antd,i["@formily/shared"],i["@ant-design/icons"]))})(this,function(i,e,u,a,l,h,g,x,y,d,U,k){"use strict";var pe=Object.defineProperty,ue=Object.defineProperties;var le=Object.getOwnPropertyDescriptors;var $=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;var I=(i,e,u)=>e in i?pe(i,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[e]=u,C=(i,e)=>{for(var u in e||(e={}))me.call(e,u)&&I(i,u,e[u]);if($)for(var u of $(e))de.call(e,u)&&I(i,u,e[u]);return i},T=(i,e)=>ue(i,le(e));var E=(i,e,u)=>(I(i,typeof e!="symbol"?e+"":e,u),u);var v=(i,e,u)=>new Promise((a,l)=>{var h=y=>{try{x(u.next(y))}catch(d){l(d)}},g=y=>{try{x(u.throw(y))}catch(d){l(d)}},x=y=>y.done?a(y.value):Promise.resolve(y.value).then(h,g);x((u=u.apply(i,e)).next())});const j="Email/Password",B=t=>{const s=h.useLocation(),o=e.useAPIClient();return l.useEffect(()=>{const r=new URLSearchParams(s.search),n=r.get("authenticator"),c=r.get("token");c&&(o.auth.setToken(c),o.auth.setAuthenticator(n))}),a.jsx(a.Fragment,{children:t.children})},b="auth";function A(){return g.useTranslation([b,"client"],{nsMode:"fallback"})}const S=l.createContext([]);S.displayName="AuthenticatorsContext";const F=t=>l.useContext(S).find(o=>o.name===t);function L(t){var c;const{data:s}=e.useSystemSettings(),o=e.useAPIClient(),{data:r=[],error:n}=e.useRequest(()=>o.resource("authenticators").publicList().then(p=>{var m;return((m=p==null?void 0:p.data)==null?void 0:m.data)||[]}));if(n)throw n;return a.jsxs("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh"},children:[a.jsx("h1",{children:(c=s==null?void 0:s.data)==null?void 0:c.title}),a.jsx(S.Provider,{value:r,children:a.jsx(h.Outlet,{})}),a.jsx("div",{className:y.css`
|
|
2
2
|
position: absolute;
|
|
3
3
|
bottom: 24px;
|
|
4
4
|
width: 100%;
|
|
5
5
|
left: 0;
|
|
6
6
|
text-align: center;
|
|
7
|
-
`,children:
|
|
7
|
+
`,children:a.jsx(e.PoweredBy,{})})]})}const O=()=>{var r;const s=e.usePlugin(f).authTypes.getEntities(),o={};for(const[n,c]of s)(r=c.components)!=null&&r.SignInForm&&(o[n]=c.components.SignInForm);return o},V=(t=[])=>{var c;const o=e.usePlugin(f).authTypes.getEntities(),r={};for(const[p,m]of o)(c=m.components)!=null&&c.SignInButton&&(r[p]=m.components.SignInButton);const n=Object.keys(r);return t.filter(p=>n.includes(p.authType)).map((p,m)=>l.createElement(r[p.authType],{key:m,authenticator:p}))},_=()=>{const{t}=A();e.useCurrentDocumentTitle("Signin"),e.useViewport();const s=O(),o=l.useContext(S),r=V(o);if(!o.length)return a.jsx("div",{style:{color:"#ccc"},children:t("No authentication methods available.")});const n=o.map(c=>{const p=s[c.authType];if(!p)return;const m=`${t("Sign-in")} (${t(c.authTypeTitle||c.authType)})`;return C({component:l.createElement(p,{authenticator:c}),tabTitle:c.title||m},c)}).filter(c=>c);return a.jsxs(d.Space,{direction:"vertical",className:y.css`
|
|
8
8
|
display: flex;
|
|
9
|
-
`,children:[
|
|
9
|
+
`,children:[n.length>1?a.jsx(d.Tabs,{items:n.map(c=>({label:c.tabTitle,key:c.name,children:c.component}))}):n.length?a.jsx("div",{children:n[0].component}):a.jsx(a.Fragment,{}),a.jsx(d.Space,{direction:"vertical",className:y.css`
|
|
10
10
|
display: flex;
|
|
11
|
-
`,children:
|
|
11
|
+
`,children:r})]})},M=l.createContext({});M.displayName="SignupPageContext";const q=()=>{var r;const s=e.usePlugin(f).authTypes.getEntities(),o={};for(const[n,c]of s)(r=c.components)!=null&&r.SignUpForm&&(o[n]=c.components.SignUpForm);return o},z=()=>{e.useViewport(),e.useCurrentDocumentTitle("Signup");const t=q(),[s]=h.useSearchParams(),o=s.get("name"),r=F(o),{authType:n}=r||{};return t[n]?l.createElement(t[n],{authenticatorName:o}):a.jsx(h.Navigate,{to:"/not-found",replace:!0})};function Z(t="/admin"){const s=h.useNavigate(),[o]=h.useSearchParams();return l.useCallback(()=>{s(o.get("redirect")||"/admin",{replace:!0})},[s,o])}const D=t=>{const s=x.useForm(),o=e.useAPIClient(),r=Z(),{refreshAsync:n}=e.useCurrentUserContext();return{run(){return v(this,null,function*(){yield s.submit(),yield o.auth.signIn(s.values,t),yield n(),r()})}}},K={type:"object",name:"passwordForm","x-component":"FormV2",properties:{account:{type:"string","x-component":"Input","x-validator":`{{(value) => {
|
|
12
12
|
if (!value) {
|
|
13
13
|
return t("Please enter your username or email");
|
|
14
14
|
}
|
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
} else {
|
|
20
20
|
return /^[^@.<>"'/]{2,16}$/.test(value) || t("Please enter a valid username");
|
|
21
21
|
}
|
|
22
|
-
}}}`,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Username/Email")}}',style:{}}},password:{type:"string","x-component":"Password",required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Password")}}',style:{}}},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign in")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:"{{ useBasicSignIn }}",style:{width:"100%"}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"{{ signUpLink }}"},"x-content":'{{t("Create an account")}}',"x-visible":"{{ allowSignUp }}"}}},oe=t=>{const{t:r}=A(),o=t.authenticator,{authType:i,name:s,options:a}=o,l=!!q()[i]&&(a==null?void 0:a.allowSignUp),ce=`/signup?name=${s}`,ae=()=>D(s);return n.jsx(e.SchemaComponent,{schema:te,scope:{useBasicSignIn:ae,allowSignUp:l,signUpLink:ce,t:r}})},ne=t=>{const r=m.useNavigate(),o=h.useForm(),i=e.useAPIClient(),{t:s}=x.useTranslation();return{run(){return v(this,null,function*(){var p;yield o.submit(),yield i.auth.signUp(o.values,t==null?void 0:t.authenticator),d.message.success(((p=t==null?void 0:t.message)==null?void 0:p.success)||s("Sign up successfully, and automatically jump to the sign in page")),setTimeout(()=>{r("/signin")},2e3)})}}},se={type:"object",name:g.uid(),"x-component":"FormV2",properties:{username:{type:"string",required:!0,"x-component":"Input","x-validator":{username:!0},"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Username")}}',style:{}}},password:{type:"string",required:!0,"x-component":"Password","x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Password")}}',checkStrength:!0,style:{}},"x-reactions":[{dependencies:[".confirm_password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},confirm_password:{type:"string",required:!0,"x-component":"Password","x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Confirm password")}}',style:{}},"x-reactions":[{dependencies:[".password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign up")}}',type:"void","x-component":"Action","x-component-props":{block:!0,type:"primary",htmlType:"submit",useAction:"{{ useBasicSignUp }}",style:{width:"100%"}}}}},link:{type:"void","x-component":"div",properties:{link:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Log in with an existing account")}}'}}}}},re=({authenticatorName:t})=>{const{t:r}=A(),o=()=>ne({authenticator:t}),i=I(t),{options:s}=i;return s!=null&&s.allowSignUp?n.jsx(e.SchemaComponent,{schema:se,scope:{useBasicSignUp:o,t:r}}):n.jsx(m.Navigate,{to:"/not-found",replace:!0})},ie=()=>{const{t}=A();return n.jsx(e.SchemaComponent,{scope:{t},components:{Alert:d.Alert},schema:{type:"object",properties:{public:{type:"object",properties:{allowSignUp:{"x-decorator":"FormItem",type:"boolean",title:'{{t("Allow to sign up")}}',"x-component":"Checkbox","x-component-props":{defaultChecked:!0}}}},notice:{type:"void","x-component":"Alert","x-component-props":{showIcon:!0,message:'{{t("The authentication allows users to sign in via username or email.")}}'}}}}})};class f extends e.Plugin{constructor(){super(...arguments);$(this,"authTypes",new E.Registry)}registerType(o,i){this.authTypes.register(o,i)}load(){return v(this,null,function*(){this.app.pluginSettingsManager.add(F,{icon:"LoginOutlined",title:`{{t("Authentication", { ns: "${F}" })}}`,Component:W,aclSnippet:"pm.auth.authenticators"}),this.router.add("auth",{Component:"AuthLayout"}),this.router.add("auth.signin",{path:"/signin",Component:"SignInPage"}),this.router.add("auth.signup",{path:"/signup",Component:"SignUpPage"}),this.app.addComponents({AuthLayout:G,SignInPage:Q,SignUpPage:Y}),this.app.providers.unshift([j,{}]),this.registerType(R,{components:{SignInForm:oe,SignUpForm:re,AdminSettingsForm:ie}})})}}c.AuthPlugin=f,c.AuthenticatorsContext=S,c.default=f,c.useAuthenticator=I,c.useSignIn=D,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
22
|
+
}}}`,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Username/Email")}}',style:{}}},password:{type:"string","x-component":"Password",required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Password")}}',style:{}}},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign in")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:"{{ useBasicSignIn }}",style:{width:"100%"}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"{{ signUpLink }}"},"x-content":'{{t("Create an account")}}',"x-visible":"{{ allowSignUp }}"}}},W=t=>{const{t:s}=A(),o=t.authenticator,{authType:r,name:n,options:c}=o,m=!!q()[r]&&(c==null?void 0:c.allowSignUp),ce=`/signup?name=${n}`,ae=()=>D(n);return a.jsx(e.SchemaComponent,{schema:K,scope:{useBasicSignIn:ae,allowSignUp:m,signUpLink:ce,t:s}})},G=t=>{const s=h.useNavigate(),o=x.useForm(),r=e.useAPIClient(),{t:n}=g.useTranslation();return{run(){return v(this,null,function*(){var p;yield o.submit(),yield r.auth.signUp(o.values,t==null?void 0:t.authenticator),d.message.success(((p=t==null?void 0:t.message)==null?void 0:p.success)||n("Sign up successfully, and automatically jump to the sign in page")),setTimeout(()=>{s("/signin")},2e3)})}}},H={type:"object",name:U.uid(),"x-component":"FormV2",properties:{username:{type:"string",required:!0,"x-component":"Input","x-validator":{username:!0},"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Username")}}',style:{}}},password:{type:"string",required:!0,"x-component":"Password","x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Password")}}',checkStrength:!0,style:{}},"x-reactions":[{dependencies:[".confirm_password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},confirm_password:{type:"string",required:!0,"x-component":"Password","x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Confirm password")}}',style:{}},"x-reactions":[{dependencies:[".password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign up")}}',type:"void","x-component":"Action","x-component-props":{block:!0,type:"primary",htmlType:"submit",useAction:"{{ useBasicSignUp }}",style:{width:"100%"}}}}},link:{type:"void","x-component":"div",properties:{link:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Log in with an existing account")}}'}}}}},J=({authenticatorName:t})=>{const{t:s}=A(),o=()=>G({authenticator:t}),r=F(t),{options:n}=r;return n!=null&&n.allowSignUp?a.jsx(e.SchemaComponent,{schema:H,scope:{useBasicSignUp:o,t:s}}):a.jsx(h.Navigate,{to:"/not-found",replace:!0})},Q=()=>{const{t}=A();return a.jsx(e.SchemaComponent,{scope:{t},components:{Alert:d.Alert},schema:{type:"object",properties:{public:{type:"object",properties:{allowSignUp:{"x-decorator":"FormItem",type:"boolean",title:'{{t("Allow to sign up")}}',"x-component":"Checkbox","x-component-props":{defaultChecked:!0}}}},notice:{type:"void","x-component":"Alert","x-component-props":{showIcon:!0,message:'{{t("The authentication allows users to sign in via username or email.")}}'}}}}})},w=l.createContext({type:""});w.displayName="AuthTypeContext";const P=l.createContext({types:[]});P.displayName="AuthTypesContext";const X=()=>{const{types:t}=l.useContext(P);return t},N={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":t=>/^[a-zA-Z0-9_-]+$/.test(t)?"":e.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(t){const s=e.useActionContext(),{type:o}=l.useContext(w);return e.useRequest(()=>Promise.resolve({data:{name:`s_${U.uid()}`,authType:o}}),T(C({},t),{refreshDeps:[s.visible]}))}},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 }}"}}}}}}}},R={type:"void",name:"authenticators","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:N,resourceName:"authenticators",dragSort:!0,request:{resource:"authenticators",action:"list",params:{pageSize:50,sort:"sort",appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:N},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(){const t=e.useAPIClient(),{t:s}=g.useTranslation();return{move(r,n){return v(this,null,function*(){yield t.resource("authenticators").move({sourceId:r.id,targetId:n.id}),d.message.success(s("Saved successfully"),.2)})}}}},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() }}"}}}}}}}}},ee=t=>{const s=e.useRecord(),o=e.useRequest(()=>Promise.resolve({data:C({},s.options)}),T(C({},t),{manual:!0})),{run:r}=o,n=e.useActionContext();return l.useEffect(()=>{n.visible&&r()},[n.visible,r]),o},te=t=>{var r;const o=e.usePlugin(f).authTypes.get(t);return(r=o==null?void 0:o.components)==null?void 0:r.AdminSettingsForm},oe=x.observer(()=>{const t=x.useForm(),s=e.useRecord(),o=te(t.values.authType||s.authType);return o?a.jsx(o,{}):null},{displayName:"Options"}),ne=()=>{const{setVisible:t}=e.useActionContext();return{run(){return v(this,null,function*(){t(!1)})}}},se=()=>{const{t}=g.useTranslation(),[s,o]=l.useState(!1),[r,n]=l.useState(""),c=X(),p=c.map(m=>T(C({},m),{onClick:()=>{o(!0),n(m.value)}}));return a.jsx(e.ActionContextProvider,{value:{visible:s,setVisible:o},children:a.jsxs(w.Provider,{value:{type:r},children:[a.jsx(d.Dropdown,{menu:{items:p},children:a.jsxs(d.Button,{icon:a.jsx(k.PlusOutlined,{}),type:"primary",children:[t("Add new")," ",a.jsx(k.DownOutlined,{})]})}),a.jsx(e.SchemaComponent,{scope:{useCloseAction:ne,types:c,setType:n},schema:Y})]})})},re=()=>(e.useAsyncData(),!1),ie=()=>{const{t}=A(),[s,o]=l.useState([]),r=e.useAPIClient();return e.useRequest(()=>r.resource("authenticators").listTypes().then(n=>{var p;return(((p=n==null?void 0:n.data)==null?void 0:p.data)||[]).map(m=>({key:m.name,label:t(m.title||m.name),value:m.name}))}),{onSuccess:n=>{o(n)}}),a.jsx(d.Card,{bordered:!1,children:a.jsx(P.Provider,{value:{types:s},children:a.jsx(e.SchemaComponent,{schema:R,components:{AddNew:se,Options:oe},scope:{types:s,useValuesFromOptions:ee,useCanNotDelete:re,t}})})})};class f extends e.Plugin{constructor(){super(...arguments);E(this,"authTypes",new u.Registry)}registerType(o,r){this.authTypes.register(o,r)}load(){return v(this,null,function*(){this.app.pluginSettingsManager.add(b,{icon:"LoginOutlined",title:`{{t("Authentication", { ns: "${b}" })}}`,Component:ie,aclSnippet:"pm.auth.authenticators"}),this.router.add("auth",{Component:"AuthLayout"}),this.router.add("auth.signin",{path:"/signin",Component:"SignInPage"}),this.router.add("auth.signup",{path:"/signup",Component:"SignUpPage"}),this.app.addComponents({AuthLayout:L,SignInPage:_,SignUpPage:z}),this.app.providers.unshift([B,{}]),this.registerType(j,{components:{SignInForm:W,SignUpForm:J,AdminSettingsForm:Q}})})}}i.AuthenticatorsContext=S,i.PluginAuthClient=f,i.default=f,i.useAuthenticator=F,i.useSignIn=D,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@nocobase/client": "0.
|
|
2
|
+
"@nocobase/client": "0.21.0-alpha.2",
|
|
3
3
|
"react": "18.2.0",
|
|
4
4
|
"react-router-dom": "6.21.0",
|
|
5
|
-
"@nocobase/utils": "0.
|
|
6
|
-
"@nocobase/auth": "0.
|
|
7
|
-
"@nocobase/database": "0.
|
|
8
|
-
"@nocobase/
|
|
9
|
-
"@nocobase/
|
|
10
|
-
"@nocobase/test": "0.
|
|
5
|
+
"@nocobase/utils": "0.21.0-alpha.2",
|
|
6
|
+
"@nocobase/auth": "0.21.0-alpha.2",
|
|
7
|
+
"@nocobase/database": "0.21.0-alpha.2",
|
|
8
|
+
"@nocobase/cache": "0.21.0-alpha.2",
|
|
9
|
+
"@nocobase/server": "0.21.0-alpha.2",
|
|
10
|
+
"@nocobase/test": "0.21.0-alpha.2",
|
|
11
11
|
"antd": "5.12.8",
|
|
12
12
|
"@formily/react": "2.3.0",
|
|
13
13
|
"@formily/shared": "2.3.0",
|
|
14
14
|
"react-i18next": "11.18.6",
|
|
15
15
|
"@emotion/css": "11.11.2",
|
|
16
16
|
"@ant-design/icons": "5.2.6",
|
|
17
|
-
"@nocobase/actions": "0.
|
|
17
|
+
"@nocobase/actions": "0.21.0-alpha.2"
|
|
18
18
|
};
|
|
@@ -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-
|
|
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-04-03T15:39:33.089Z"}
|
package/dist/server/plugin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InstallOptions, Plugin } from '@nocobase/server';
|
|
2
1
|
import { Cache } from '@nocobase/cache';
|
|
3
|
-
|
|
2
|
+
import { InstallOptions, Plugin } from '@nocobase/server';
|
|
3
|
+
export declare class PluginAuthServer extends Plugin {
|
|
4
4
|
cache: Cache;
|
|
5
5
|
afterAdd(): void;
|
|
6
6
|
beforeLoad(): Promise<void>;
|
|
@@ -8,4 +8,4 @@ export declare class AuthPlugin extends Plugin {
|
|
|
8
8
|
install(options?: InstallOptions): Promise<void>;
|
|
9
9
|
remove(): Promise<void>;
|
|
10
10
|
}
|
|
11
|
-
export default
|
|
11
|
+
export default PluginAuthServer;
|
package/dist/server/plugin.js
CHANGED
|
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
var plugin_exports = {};
|
|
29
29
|
__export(plugin_exports, {
|
|
30
|
-
|
|
30
|
+
PluginAuthServer: () => PluginAuthServer,
|
|
31
31
|
default: () => plugin_default
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(plugin_exports);
|
|
@@ -39,9 +39,9 @@ var import_authenticators = __toESM(require("./actions/authenticators"));
|
|
|
39
39
|
var import_basic_auth = require("./basic-auth");
|
|
40
40
|
var import_locale = require("./locale");
|
|
41
41
|
var import_authenticator = require("./model/authenticator");
|
|
42
|
-
var import_token_blacklist = require("./token-blacklist");
|
|
43
42
|
var import_storer = require("./storer");
|
|
44
|
-
|
|
43
|
+
var import_token_blacklist = require("./token-blacklist");
|
|
44
|
+
class PluginAuthServer extends import_server.Plugin {
|
|
45
45
|
cache;
|
|
46
46
|
afterAdd() {
|
|
47
47
|
}
|
|
@@ -124,8 +124,8 @@ class AuthPlugin extends import_server.Plugin {
|
|
|
124
124
|
async remove() {
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
var plugin_default =
|
|
127
|
+
var plugin_default = PluginAuthServer;
|
|
128
128
|
// Annotate the CommonJS export names for ESM import in node:
|
|
129
129
|
0 && (module.exports = {
|
|
130
|
-
|
|
130
|
+
PluginAuthServer
|
|
131
131
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0-alpha.2",
|
|
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": "90628f2e2da846208fb2d7966ddb4e467d187ffb",
|
|
30
30
|
"keywords": [
|
|
31
31
|
"Authentication"
|
|
32
32
|
]
|