@nocobase/plugin-auth
Advanced tools
Comparing version 0.13.0-alpha.5 to 0.13.0-alpha.6
@@ -1,2 +0,2 @@ | ||
(function(o,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("antd"),require("react"),require("@formily/shared"),require("react-i18next"),require("@ant-design/icons"),require("@formily/react")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","antd","react","@formily/shared","react-i18next","@ant-design/icons","@formily/react"],e):(o=typeof globalThis!="undefined"?globalThis:o||self,e(o["@nocobase/plugin-auth"]={},o["@nocobase/client"],o.jsxRuntime,o.antd,o.react,o["@formily/shared"],o["react-i18next"],o["@ant-design/icons"],o["@formily/react"]))})(this,function(o,e,t,l,p,g,y,d,a){"use strict";var H=Object.defineProperty,J=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var F=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var P=(o,e,t)=>e in o?H(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,C=(o,e)=>{for(var t in e||(e={}))W.call(e,t)&&P(o,t,e[t]);if(F)for(var t of F(e))X.call(e,t)&&P(o,t,e[t]);return o},A=(o,e)=>J(o,Q(e));var b=(o,e,t)=>new Promise((l,p)=>{var g=a=>{try{d(t.next(a))}catch(x){p(x)}},y=a=>{try{d(t.throw(a))}catch(x){p(x)}},d=a=>a.done?l(a.value):Promise.resolve(a.value).then(g,y);d((t=t.apply(o,e)).next())});const x=p.createContext({type:""}),S=p.createContext({types:[]}),I=()=>{const{types:n}=p.useContext(S);return n},w={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",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"}}]},D={type:"object",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(n){const r=e.useActionContext(),{type:i}=p.useContext(x);return e.useRequest(()=>Promise.resolve({data:{name:`s_${g.uid()}`,authType:i}}),A(C({},n),{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 }}"}}}}}}}},k={type:"void",name:"authenticators","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:w,resourceName:"authenticators",dragSort:!0,request:{resource:"authenticators",action:"list",params:{pageSize:50,sort:"sort",appends:[]}}},"x-component":"CollectionProvider","x-component-props":{collection:w},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 n=e.useAPIClient(),{t:r}=y.useTranslation();return{move(c,s){return b(this,null,function*(){yield n.resource("authenticators").move({sourceId:c.id,targetId:s.id}),l.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() }}"}}}}}}}}},q=n=>{const r=e.useRecord(),i=e.useRequest(()=>Promise.resolve({data:C({},r.options)}),A(C({},n),{manual:!0})),{run:c}=i,s=e.useActionContext();return p.useEffect(()=>{s.visible&&c()},[s.visible,c]),i},j=a.observer(()=>{const n=a.useForm(),r=e.useRecord();return e.useOptionsComponent(n.values.authType||r.authType)}),$="auth";function h(){return y.useTranslation($)}const O=()=>{const{setVisible:n}=e.useActionContext();return{run(){return b(this,null,function*(){n(!1)})}}},V=()=>{const{t:n}=y.useTranslation(),[r,i]=p.useState(!1),[c,s]=p.useState(""),m=I(),v=m.map(u=>A(C({},u),{onClick:()=>{i(!0),s(u.value)}}));return t.jsx(e.ActionContextProvider,{value:{visible:r,setVisible:i},children:t.jsxs(x.Provider,{value:{type:c},children:[t.jsx(l.Dropdown,{menu:{items:v},children:t.jsxs(l.Button,{icon:t.jsx(d.PlusOutlined,{}),type:"primary",children:[n("Add new")," ",t.jsx(d.DownOutlined,{})]})}),t.jsx(e.SchemaComponent,{scope:{useCloseAction:O,types:m,setType:s},schema:D})]})})},B=()=>(e.useAsyncData(),!1),E=()=>{const{t:n}=h(),[r,i]=p.useState([]),c=e.useAPIClient();return e.useRequest(()=>c.resource("authenticators").listTypes().then(s=>{var v;return(((v=s==null?void 0:s.data)==null?void 0:v.data)||[]).map(u=>({key:u.name,label:n(u.title||u.name),value:u.name}))}),{onSuccess:s=>{i(s)}}),t.jsx(l.Card,{bordered:!1,children:t.jsx(S.Provider,{value:{types:r},children:t.jsx(e.SchemaComponent,{schema:k,components:{AddNew:V,Options:j},scope:{types:r,useValuesFromOptions:q,useCanNotDelete:B,t:n}})})})},L={type:"object",name:"passwordForm","x-component":"FormV2",properties:{account:{type:"string","x-component":"Input","x-validator":`{{(value) => { | ||
(function(o,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("antd"),require("react"),require("@formily/shared"),require("react-i18next"),require("@ant-design/icons"),require("@formily/react")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","antd","react","@formily/shared","react-i18next","@ant-design/icons","@formily/react"],e):(o=typeof globalThis!="undefined"?globalThis:o||self,e(o["@nocobase/plugin-auth"]={},o["@nocobase/client"],o.jsxRuntime,o.antd,o.react,o["@formily/shared"],o["react-i18next"],o["@ant-design/icons"],o["@formily/react"]))})(this,function(o,e,t,l,p,A,y,d,a){"use strict";var G=Object.defineProperty,H=Object.defineProperties;var J=Object.getOwnPropertyDescriptors;var F=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var P=(o,e,t)=>e in o?G(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,C=(o,e)=>{for(var t in e||(e={}))Q.call(e,t)&&P(o,t,e[t]);if(F)for(var t of F(e))W.call(e,t)&&P(o,t,e[t]);return o},g=(o,e)=>H(o,J(e));var b=(o,e,t)=>new Promise((l,p)=>{var A=a=>{try{d(t.next(a))}catch(x){p(x)}},y=a=>{try{d(t.throw(a))}catch(x){p(x)}},d=a=>a.done?l(a.value):Promise.resolve(a.value).then(A,y);d((t=t.apply(o,e)).next())});const x=p.createContext({type:""}),S=p.createContext({types:[]}),I=()=>{const{types:n}=p.useContext(S);return n},w={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":n=>/^[a-zA-Z0-9_-]+$/.test(n)?"":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"}}]},D={type:"object",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(n){const r=e.useActionContext(),{type:i}=p.useContext(x);return e.useRequest(()=>Promise.resolve({data:{name:`s_${A.uid()}`,authType:i}}),g(C({},n),{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 }}"}}}}}}}},k={type:"void",name:"authenticators","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:w,resourceName:"authenticators",dragSort:!0,request:{resource:"authenticators",action:"list",params:{pageSize:50,sort:"sort",appends:[]}}},"x-component":"CollectionProvider","x-component-props":{collection:w},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 n=e.useAPIClient(),{t:r}=y.useTranslation();return{move(c,s){return b(this,null,function*(){yield n.resource("authenticators").move({sourceId:c.id,targetId:s.id}),l.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() }}"}}}}}}}}},q=n=>{const r=e.useRecord(),i=e.useRequest(()=>Promise.resolve({data:C({},r.options)}),g(C({},n),{manual:!0})),{run:c}=i,s=e.useActionContext();return p.useEffect(()=>{s.visible&&c()},[s.visible,c]),i},$=a.observer(()=>{const n=a.useForm(),r=e.useRecord();return e.useOptionsComponent(n.values.authType||r.authType)}),j="auth";function h(){return y.useTranslation(j)}const O=()=>{const{setVisible:n}=e.useActionContext();return{run(){return b(this,null,function*(){n(!1)})}}},V=()=>{const{t:n}=y.useTranslation(),[r,i]=p.useState(!1),[c,s]=p.useState(""),m=I(),v=m.map(u=>g(C({},u),{onClick:()=>{i(!0),s(u.value)}}));return t.jsx(e.ActionContextProvider,{value:{visible:r,setVisible:i},children:t.jsxs(x.Provider,{value:{type:c},children:[t.jsx(l.Dropdown,{menu:{items:v},children:t.jsxs(l.Button,{icon:t.jsx(d.PlusOutlined,{}),type:"primary",children:[n("Add new")," ",t.jsx(d.DownOutlined,{})]})}),t.jsx(e.SchemaComponent,{scope:{useCloseAction:O,types:m,setType:s},schema:D})]})})},B=()=>(e.useAsyncData(),!1),E=()=>{const{t:n}=h(),[r,i]=p.useState([]),c=e.useAPIClient();return e.useRequest(()=>c.resource("authenticators").listTypes().then(s=>{var v;return(((v=s==null?void 0:s.data)==null?void 0:v.data)||[]).map(u=>({key:u.name,label:n(u.title||u.name),value:u.name}))}),{onSuccess:s=>{i(s)}}),t.jsx(l.Card,{bordered:!1,children:t.jsx(S.Provider,{value:{types:r},children:t.jsx(e.SchemaComponent,{schema:k,components:{AddNew:V,Options:$},scope:{types:r,useValuesFromOptions:q,useCanNotDelete:B,t:n}})})})},L={type:"object",name:"passwordForm","x-component":"FormV2",properties:{account:{type:"string","x-component":"Input","x-validator":`{{(value) => { | ||
if (!value) { | ||
@@ -12,2 +12,2 @@ return t("Please enter your username or email"); | ||
} | ||
}}}`,"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 }}"}}},N=n=>{const{t:r}=h(),i=n.authenticator,{authType:c,name:s,options:m}=i,u=!!p.useContext(e.SignupPageContext)[c]&&(m==null?void 0:m.allowSignup),K=`/signup?authType=${c}&name=${s}`,G=()=>e.useSignIn(s);return t.jsx(e.SchemaComponent,{schema:L,scope:{useBasicSignIn:G,allowSignUp:u,signupLink:K,t:r}})},f="Email/Password",U={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")}}'}}}}},_=n=>{const{t:r}=h(),i=()=>e.useSignup({authenticator:n.name});return t.jsx(e.SchemaComponent,{schema:U,scope:{useBasicSignup:i,t:r}})},M=()=>{const{t:n}=h();return t.jsx(e.SchemaComponent,{scope:{t:n},components:{Alert:l.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.")}}'}}}}})},z=n=>{const{t:r}=h();return t.jsx(e.SettingsCenterProvider,{settings:{auth:{title:r("Authentication"),icon:"LoginOutlined",tabs:{authenticators:{title:r("Authenticators"),component:()=>t.jsx(E,{})}}}},children:t.jsx(e.OptionsComponentProvider,{authType:f,component:M,children:t.jsx(e.SigninPageProvider,{authType:f,tabTitle:r("Sign in via password"),component:N,children:t.jsx(e.SignupPageProvider,{authType:f,component:_,children:n.children})})})})};class T extends e.Plugin{load(){return b(this,null,function*(){this.app.use(z)})}}o.AuthPlugin=T,o.default=T,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
}}}`,"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 }}"}}},_=n=>{const{t:r}=h(),i=n.authenticator,{authType:c,name:s,options:m}=i,u=!!p.useContext(e.SignupPageContext)[c]&&(m==null?void 0:m.allowSignup),Z=`/signup?authType=${c}&name=${s}`,K=()=>e.useSignIn(s);return t.jsx(e.SchemaComponent,{schema:L,scope:{useBasicSignIn:K,allowSignUp:u,signupLink:Z,t:r}})},f="Email/Password",N={type:"object",name:A.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")}}'}}}}},U=n=>{const{t:r}=h(),i=()=>e.useSignup({authenticator:n.name});return t.jsx(e.SchemaComponent,{schema:N,scope:{useBasicSignup:i,t:r}})},z=()=>{const{t:n}=h();return t.jsx(e.SchemaComponent,{scope:{t:n},components:{Alert:l.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.")}}'}}}}})},M=n=>{const{t:r}=h();return t.jsx(e.SettingsCenterProvider,{settings:{auth:{title:r("Authentication"),icon:"LoginOutlined",tabs:{authenticators:{title:r("Authenticators"),component:()=>t.jsx(E,{})}}}},children:t.jsx(e.OptionsComponentProvider,{authType:f,component:z,children:t.jsx(e.SigninPageProvider,{authType:f,tabTitle:r("Sign in via password"),component:_,children:t.jsx(e.SignupPageProvider,{authType:f,component:U,children:n.children})})})})};class T extends e.Plugin{load(){return b(this,null,function*(){this.app.use(M)})}}o.AuthPlugin=T,o.default=T,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); |
@@ -1,1 +0,1 @@ | ||
{"name":"cron","description":"Cron jobs for your node","version":"2.3.1","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"},"dependencies":{"luxon":"^3.2.1"},"devDependencies":{"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","jest":"~29.5.x","prettier":"~2.8.x","sinon":"^15.0.x"},"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","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"2023-09-03T03:43:55.836Z"} | ||
{"name":"cron","description":"Cron jobs for your node","version":"2.3.1","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"},"dependencies":{"luxon":"^3.2.1"},"devDependencies":{"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","jest":"~29.5.x","prettier":"~2.8.x","sinon":"^15.0.x"},"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","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"2023-09-04T12:57:50.058Z"} |
{ | ||
"name": "@nocobase/plugin-auth", | ||
"version": "0.13.0-alpha.5", | ||
"version": "0.13.0-alpha.6", | ||
"main": "./dist/server/index.js", | ||
@@ -27,3 +27,3 @@ "devDependencies": { | ||
"description.zh-CN": "提供基础认证功能和扩展认证器管理功能", | ||
"gitHead": "9eabe607b4a20c356fdb2fd95e40fa476986dcb0" | ||
"gitHead": "49ef71c8bdaab986f47c8a84bcf15e2123ba9b59" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
240122
3961