@nocobase/plugin-auth 1.2.13-alpha → 1.3.0-alpha.20240710084543
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/package.json +2 -2
- package/dist/client/AuthProvider.d.ts +0 -10
- package/dist/client/authenticator.d.ts +0 -21
- package/dist/client/basic/Options.d.ts +0 -10
- package/dist/client/basic/SignInForm.d.ts +0 -17
- package/dist/client/basic/SignUpForm.d.ts +0 -21
- package/dist/client/basic/index.d.ts +0 -11
- package/dist/client/index.d.ts +0 -35
- package/dist/client/index.js +0 -31
- package/dist/client/locale/index.d.ts +0 -10
- package/dist/client/pages/AuthLayout.d.ts +0 -13
- package/dist/client/pages/SignInPage.d.ts +0 -24
- package/dist/client/pages/SignUpPage.d.ts +0 -29
- package/dist/client/pages/index.d.ts +0 -11
- package/dist/client/settings/Authenticator.d.ts +0 -10
- package/dist/client/settings/Options.d.ts +0 -12
- package/dist/client/settings/authType.d.ts +0 -24
- package/dist/client/settings/schemas/authenticators.d.ts +0 -11
- package/dist/externalVersion.js +0 -27
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -49
- package/dist/locale/en-US.json +0 -27
- package/dist/locale/ko_KR.json +0 -26
- package/dist/locale/zh-CN.json +0 -27
- package/dist/node_modules/cron/LICENSE +0 -8
- package/dist/node_modules/cron/lib/cron.js +0 -1
- package/dist/node_modules/cron/lib/job.js +0 -215
- package/dist/node_modules/cron/lib/time.js +0 -830
- package/dist/node_modules/cron/node_modules/luxon/build/amd/luxon.js +0 -7826
- package/dist/node_modules/cron/node_modules/luxon/build/cjs-browser/luxon.js +0 -7824
- package/dist/node_modules/cron/node_modules/luxon/build/es6/luxon.js +0 -7217
- package/dist/node_modules/cron/node_modules/luxon/build/global/luxon.js +0 -7829
- package/dist/node_modules/cron/node_modules/luxon/build/global/luxon.min.js +0 -1
- package/dist/node_modules/cron/node_modules/luxon/build/node/luxon.js +0 -6932
- package/dist/node_modules/cron/node_modules/luxon/package.json +0 -85
- package/dist/node_modules/cron/node_modules/luxon/src/datetime.js +0 -2248
- package/dist/node_modules/cron/node_modules/luxon/src/duration.js +0 -948
- package/dist/node_modules/cron/node_modules/luxon/src/errors.js +0 -61
- package/dist/node_modules/cron/node_modules/luxon/src/impl/conversions.js +0 -161
- package/dist/node_modules/cron/node_modules/luxon/src/impl/diff.js +0 -75
- package/dist/node_modules/cron/node_modules/luxon/src/impl/digits.js +0 -75
- package/dist/node_modules/cron/node_modules/luxon/src/impl/english.js +0 -233
- package/dist/node_modules/cron/node_modules/luxon/src/impl/formats.js +0 -176
- package/dist/node_modules/cron/node_modules/luxon/src/impl/formatter.js +0 -400
- package/dist/node_modules/cron/node_modules/luxon/src/impl/invalid.js +0 -14
- package/dist/node_modules/cron/node_modules/luxon/src/impl/locale.js +0 -494
- package/dist/node_modules/cron/node_modules/luxon/src/impl/regexParser.js +0 -335
- package/dist/node_modules/cron/node_modules/luxon/src/impl/tokenParser.js +0 -444
- package/dist/node_modules/cron/node_modules/luxon/src/impl/util.js +0 -274
- package/dist/node_modules/cron/node_modules/luxon/src/impl/zoneUtil.js +0 -34
- package/dist/node_modules/cron/node_modules/luxon/src/info.js +0 -169
- package/dist/node_modules/cron/node_modules/luxon/src/interval.js +0 -637
- package/dist/node_modules/cron/node_modules/luxon/src/luxon.js +0 -26
- package/dist/node_modules/cron/node_modules/luxon/src/package.json +0 -4
- package/dist/node_modules/cron/node_modules/luxon/src/settings.js +0 -148
- package/dist/node_modules/cron/node_modules/luxon/src/zone.js +0 -91
- package/dist/node_modules/cron/node_modules/luxon/src/zones/IANAZone.js +0 -189
- package/dist/node_modules/cron/node_modules/luxon/src/zones/fixedOffsetZone.js +0 -102
- package/dist/node_modules/cron/node_modules/luxon/src/zones/invalidZone.js +0 -53
- package/dist/node_modules/cron/node_modules/luxon/src/zones/systemZone.js +0 -61
- package/dist/node_modules/cron/package.json +0 -1
- package/dist/node_modules/cron/types/index.d.ts +0 -181
- package/dist/node_modules/cron/types/index.test-d.ts +0 -85
- package/dist/preset.d.ts +0 -11
- package/dist/preset.js +0 -43
- package/dist/server/actions/auth.d.ts +0 -16
- package/dist/server/actions/auth.js +0 -50
- package/dist/server/actions/authenticators.d.ts +0 -16
- package/dist/server/actions/authenticators.js +0 -112
- package/dist/server/basic-auth.d.ts +0 -18
- package/dist/server/basic-auth.js +0 -192
- package/dist/server/collections/authenticators.d.ts +0 -13
- package/dist/server/collections/authenticators.js +0 -126
- package/dist/server/collections/token-blacklist.d.ts +0 -10
- package/dist/server/collections/token-blacklist.js +0 -51
- package/dist/server/collections/users-authenticators.d.ts +0 -14
- package/dist/server/collections/users-authenticators.js +0 -94
- package/dist/server/index.d.ts +0 -11
- package/dist/server/index.js +0 -51
- package/dist/server/locale/en-US.d.ts +0 -17
- package/dist/server/locale/en-US.js +0 -39
- package/dist/server/locale/fr-FR.d.ts +0 -17
- package/dist/server/locale/fr-FR.js +0 -39
- package/dist/server/locale/index.d.ts +0 -11
- package/dist/server/locale/index.js +0 -52
- package/dist/server/locale/ja-JP.d.ts +0 -13
- package/dist/server/locale/ja-JP.js +0 -35
- package/dist/server/locale/pt-BR.d.ts +0 -17
- package/dist/server/locale/pt-BR.js +0 -39
- package/dist/server/locale/zh-CN.d.ts +0 -19
- package/dist/server/locale/zh-CN.js +0 -41
- package/dist/server/migrations/20230506152253-basic-authenticator.d.ts +0 -14
- package/dist/server/migrations/20230506152253-basic-authenticator.js +0 -53
- package/dist/server/migrations/20230607174500-update-basic.d.ts +0 -14
- package/dist/server/migrations/20230607174500-update-basic.js +0 -56
- package/dist/server/migrations/20231218132032-fix-allow-signup.d.ts +0 -14
- package/dist/server/migrations/20231218132032-fix-allow-signup.js +0 -64
- package/dist/server/model/authenticator.d.ts +0 -17
- package/dist/server/model/authenticator.js +0 -78
- package/dist/server/plugin.d.ts +0 -19
- package/dist/server/plugin.js +0 -138
- package/dist/server/storer.d.ts +0 -24
- package/dist/server/storer.js +0 -78
- package/dist/server/token-blacklist.d.ts +0 -25
- package/dist/server/token-blacklist.js +0 -95
- package/dist/swagger/index.d.ts +0 -762
- package/dist/swagger/index.js +0 -796
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-auth",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-alpha.20240710084543",
|
|
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": "07a8b596fc64a9779a194cb9b0dc2ca7570ed9d4",
|
|
30
30
|
"keywords": [
|
|
31
31
|
"Authentication"
|
|
32
32
|
]
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
export declare const AuthProvider: React.FC;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
/// <reference types="react" />
|
|
10
|
-
export type Authenticator = {
|
|
11
|
-
name: string;
|
|
12
|
-
authType: string;
|
|
13
|
-
authTypeTitle: string;
|
|
14
|
-
title?: string;
|
|
15
|
-
options?: {
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
};
|
|
18
|
-
sort?: number;
|
|
19
|
-
};
|
|
20
|
-
export declare const AuthenticatorsContext: import("react").Context<Authenticator[]>;
|
|
21
|
-
export declare const useAuthenticator: (name: string) => Authenticator;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
export declare const Options: () => React.JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import { Authenticator } from '../authenticator';
|
|
11
|
-
export declare function useRedirect(next?: string): () => void;
|
|
12
|
-
export declare const useSignIn: (authenticator: string) => {
|
|
13
|
-
run(): Promise<void>;
|
|
14
|
-
};
|
|
15
|
-
export declare const SignInForm: (props: {
|
|
16
|
-
authenticator: Authenticator;
|
|
17
|
-
}) => React.JSX.Element;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
export interface UseSignupProps {
|
|
11
|
-
authenticator?: string;
|
|
12
|
-
message?: {
|
|
13
|
-
success?: string;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export declare const useSignUp: (props?: UseSignupProps) => {
|
|
17
|
-
run(): Promise<void>;
|
|
18
|
-
};
|
|
19
|
-
export declare const SignUpForm: ({ authenticatorName: name }: {
|
|
20
|
-
authenticatorName: string;
|
|
21
|
-
}) => React.JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export * from './SignInForm';
|
|
10
|
-
export * from './SignUpForm';
|
|
11
|
-
export * from './Options';
|
package/dist/client/index.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { Plugin } from '@nocobase/client';
|
|
10
|
-
import { ComponentType } from 'react';
|
|
11
|
-
import { Authenticator as AuthenticatorType } from './authenticator';
|
|
12
|
-
export { AuthenticatorsContextProvider, AuthLayout } from './pages/AuthLayout';
|
|
13
|
-
export type AuthOptions = {
|
|
14
|
-
components: Partial<{
|
|
15
|
-
SignInForm: ComponentType<{
|
|
16
|
-
authenticator: AuthenticatorType;
|
|
17
|
-
}>;
|
|
18
|
-
SignInButton: ComponentType<{
|
|
19
|
-
authenticator: AuthenticatorType;
|
|
20
|
-
}>;
|
|
21
|
-
SignUpForm: ComponentType<{
|
|
22
|
-
authenticatorName: string;
|
|
23
|
-
}>;
|
|
24
|
-
AdminSettingsForm: ComponentType;
|
|
25
|
-
}>;
|
|
26
|
-
};
|
|
27
|
-
export declare class PluginAuthClient extends Plugin {
|
|
28
|
-
authTypes: any;
|
|
29
|
-
registerType(authType: string, options: AuthOptions): void;
|
|
30
|
-
load(): Promise<void>;
|
|
31
|
-
}
|
|
32
|
-
export { AuthenticatorsContext, useAuthenticator } from './authenticator';
|
|
33
|
-
export type { Authenticator } from './authenticator';
|
|
34
|
-
export { useSignIn } from './basic';
|
|
35
|
-
export default PluginAuthClient;
|
package/dist/client/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
(function(i,t){typeof exports=="object"&&typeof module!="undefined"?t(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"],t):(i=typeof globalThis!="undefined"?globalThis:i||self,t(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,t,u,a,l,h,g,x,y,d,U,k){"use strict";var ue=Object.defineProperty,le=Object.defineProperties;var me=Object.getOwnPropertyDescriptors;var L=Object.getOwnPropertySymbols;var de=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable;var I=(i,t,u)=>t in i?ue(i,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[t]=u,C=(i,t)=>{for(var u in t||(t={}))de.call(t,u)&&I(i,u,t[u]);if(L)for(var u of L(t))ye.call(t,u)&&I(i,u,t[u]);return i},T=(i,t)=>le(i,me(t));var j=(i,t,u)=>(I(i,typeof t!="symbol"?t+"":t,u),u);var v=(i,t,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,t)).next())});const B="Email/Password",O=e=>{const n=h.useLocation(),o=t.useApp();return l.useEffect(()=>{const r=new URLSearchParams(n.search),s=r.get("authenticator"),c=r.get("token");c&&(o.apiClient.auth.setToken(c),o.apiClient.auth.setAuthenticator(s))}),a.jsx(a.Fragment,{children:e.children})},b="auth";function A(){return g.useTranslation([b,"client"],{nsMode:"fallback"})}const S=l.createContext([]);S.displayName="AuthenticatorsContext";const F=e=>l.useContext(S).find(o=>o.name===e),q=({children:e})=>{const n=t.useAPIClient(),{data:o=[],error:r,loading:s}=t.useRequest(()=>n.resource("authenticators").publicList().then(c=>{var p;return((p=c==null?void 0:c.data)==null?void 0:p.data)||[]}));if(s)return a.jsx(d.Spin,{});if(r)throw r;return a.jsx(S.Provider,{value:o,children:e})};function D(){var n;const{data:e}=t.useSystemSettings();return a.jsxs("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh"},children:[a.jsx("h1",{children:(n=e==null?void 0:e.data)==null?void 0:n.title}),a.jsx(q,{children:a.jsx(h.Outlet,{})}),a.jsx("div",{className:y.css`
|
|
11
|
-
position: absolute;
|
|
12
|
-
bottom: 24px;
|
|
13
|
-
width: 100%;
|
|
14
|
-
left: 0;
|
|
15
|
-
text-align: center;
|
|
16
|
-
`,children:a.jsx(t.PoweredBy,{})})]})}const V=()=>{var r;const n=t.usePlugin(f).authTypes.getEntities(),o={};for(const[s,c]of n)(r=c.components)!=null&&r.SignInForm&&(o[s]=c.components.SignInForm);return o},_=(e=[])=>{var c;const o=t.usePlugin(f).authTypes.getEntities(),r={};for(const[p,m]of o)(c=m.components)!=null&&c.SignInButton&&(r[p]=m.components.SignInButton);const s=Object.keys(r);return e.filter(p=>s.includes(p.authType)).map((p,m)=>l.createElement(r[p.authType],{key:m,authenticator:p}))},M=()=>{const{t:e}=A();t.useCurrentDocumentTitle("Signin"),t.useViewport();const n=V(),o=l.useContext(S),r=_(o);if(!o.length)return a.jsx("div",{style:{color:"#ccc"},children:e("No authentication methods available.")});const s=o.map(c=>{const p=n[c.authType];if(!p)return;const m=`${e("Sign-in")} (${x.Schema.compile(c.authTypeTitle||c.authType,{t:e})})`;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`
|
|
17
|
-
display: flex;
|
|
18
|
-
`,children:[s.length>1?a.jsx(d.Tabs,{items:s.map(c=>({label:c.tabTitle,key:c.name,children:c.component}))}):s.length?a.jsx("div",{children:s[0].component}):a.jsx(a.Fragment,{}),a.jsx(d.Space,{direction:"vertical",className:y.css`
|
|
19
|
-
display: flex;
|
|
20
|
-
`,children:r})]})},z=l.createContext({});z.displayName="SignupPageContext";const N=()=>{var r;const n=t.usePlugin(f).authTypes.getEntities(),o={};for(const[s,c]of n)(r=c.components)!=null&&r.SignUpForm&&(o[s]=c.components.SignUpForm);return o},Z=()=>{t.useViewport(),t.useCurrentDocumentTitle("Signup");const e=N(),[n]=h.useSearchParams(),o=n.get("name"),r=F(o),{authType:s}=r||{};return e[s]?l.createElement(e[s],{authenticatorName:o}):a.jsx(h.Navigate,{to:"/not-found",replace:!0})};function K(e="/admin"){const n=h.useNavigate(),[o]=h.useSearchParams();return l.useCallback(()=>{n(o.get("redirect")||"/admin",{replace:!0})},[n,o])}const $=e=>{const n=x.useForm(),o=t.useAPIClient(),r=K(),{refreshAsync:s}=t.useCurrentUserContext();return{run(){return v(this,null,function*(){yield n.submit(),yield o.auth.signIn(n.values,e),yield s(),r()})}}},W={type:"object",name:"passwordForm","x-component":"FormV2",properties:{account:{type:"string","x-component":"Input","x-validator":`{{(value) => {
|
|
21
|
-
if (!value) {
|
|
22
|
-
return t("Please enter your username or email");
|
|
23
|
-
}
|
|
24
|
-
if (value.includes('@')) {
|
|
25
|
-
if (!/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/.test(value)) {
|
|
26
|
-
return t("Please enter a valid email");
|
|
27
|
-
}
|
|
28
|
-
} else {
|
|
29
|
-
return /^[^@.<>"'/]{1,50}$/.test(value) || t("Please enter a valid username");
|
|
30
|
-
}
|
|
31
|
-
}}}`,"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 }}"}}},G=e=>{const{t:n}=A(),o=e.authenticator,{authType:r,name:s,options:c}=o,m=!!(N()[r]&&(c!=null&&c.allowSignUp)),ae=`/signup?name=${s}`,pe=()=>$(s);return a.jsx(t.SchemaComponent,{schema:W,scope:{useBasicSignIn:pe,allowSignUp:m,signUpLink:ae,t:n}})},H=e=>{const n=h.useNavigate(),o=x.useForm(),r=t.useAPIClient(),{t:s}=g.useTranslation();return{run(){return v(this,null,function*(){var p;yield o.submit(),yield r.auth.signUp(o.values,e==null?void 0:e.authenticator),d.message.success(((p=e==null?void 0:e.message)==null?void 0:p.success)||s("Sign up successfully, and automatically jump to the sign in page")),setTimeout(()=>{n("/signin")},2e3)})}}},J={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")}}'}}}}},Q=({authenticatorName:e})=>{const{t:n}=A(),o=()=>H({authenticator:e}),r=F(e),{options:s}=r;return s!=null&&s.allowSignUp?a.jsx(t.SchemaComponent,{schema:J,scope:{useBasicSignUp:o,t:n}}):a.jsx(h.Navigate,{to:"/not-found",replace:!0})},X=()=>{const{t:e}=A();return a.jsx(t.SchemaComponent,{scope:{t:e},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",default:!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 Y=()=>{const{types:e}=l.useContext(P);return e},E={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":e=>/^[a-zA-Z0-9_-]+$/.test(e)?"":t.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"}}]},R={type:"object",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(e){const n=t.useActionContext(),{type:o}=l.useContext(w);return t.useRequest(()=>Promise.resolve({data:{name:`s_${U.uid()}`,authType:o}}),T(C({},e),{refreshDeps:[n.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 }}"}}}}}}}},ee={type:"void",name:"authenticators","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:E,resourceName:"authenticators",dragSort:!0,request:{resource:"authenticators",action:"list",params:{pageSize:50,sort:"sort",appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:E},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 e=t.useAPIClient(),{t:n}=g.useTranslation();return{move(r,s){return v(this,null,function*(){yield e.resource("authenticators").move({sourceId:r.id,targetId:s.id}),d.message.success(n("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() }}"}}}}}}}}},te=e=>{const n=t.useRecord(),o=t.useRequest(()=>Promise.resolve({data:C({},n.options)}),T(C({},e),{manual:!0})),{run:r}=o,s=t.useActionContext();return l.useEffect(()=>{s.visible&&r()},[s.visible,r]),o},oe=e=>{var r;const o=t.usePlugin(f).authTypes.get(e);return(r=o==null?void 0:o.components)==null?void 0:r.AdminSettingsForm},ne=x.observer(()=>{const e=x.useForm(),n=t.useRecord(),o=oe(e.values.authType||n.authType);return o?a.jsx(o,{}):null},{displayName:"Options"}),se=()=>{const{setVisible:e}=t.useActionContext();return{run(){return v(this,null,function*(){e(!1)})}}},re=()=>{const{t:e}=g.useTranslation(),[n,o]=l.useState(!1),[r,s]=l.useState(""),c=Y(),p=c.map(m=>T(C({},m),{onClick:()=>{o(!0),s(m.value)}}));return a.jsx(t.ActionContextProvider,{value:{visible:n,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:[e("Add new")," ",a.jsx(k.DownOutlined,{})]})}),a.jsx(t.SchemaComponent,{scope:{useCloseAction:se,types:c,setType:s},schema:R})]})})},ie=()=>(t.useAsyncData(),!1),ce=()=>{const{t:e}=A(),[n,o]=l.useState([]),r=t.useAPIClient();return t.useRequest(()=>r.resource("authenticators").listTypes().then(s=>{var p;return(((p=s==null?void 0:s.data)==null?void 0:p.data)||[]).map(m=>({key:m.name,label:x.Schema.compile(m.title||m.name,{t:e}),value:m.name}))}),{onSuccess:s=>{o(s)}}),a.jsx(d.Card,{bordered:!1,children:a.jsx(P.Provider,{value:{types:n},children:a.jsx(t.SchemaComponent,{schema:ee,components:{AddNew:re,Options:ne},scope:{types:n,useValuesFromOptions:te,useCanNotDelete:ie,t:e}})})})};class f extends t.Plugin{constructor(){super(...arguments);j(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:ce,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:D,SignInPage:M,SignUpPage:Z}),this.app.providers.unshift([O,{}]),this.registerType(B,{components:{SignInForm:G,SignUpForm:Q,AdminSettingsForm:X}})})}}i.AuthLayout=D,i.AuthenticatorsContext=S,i.AuthenticatorsContextProvider=q,i.PluginAuthClient=f,i.default=f,i.useAuthenticator=F,i.useSignIn=$,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export declare const NAMESPACE = "auth";
|
|
10
|
-
export declare function useAuthTranslation(): import("react-i18next").UseTranslationResponse<("auth" | "client")[], undefined>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import React, { FC } from 'react';
|
|
10
|
-
export declare const AuthenticatorsContextProvider: FC<{
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
}>;
|
|
13
|
-
export declare function AuthLayout(): React.JSX.Element;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import { AuthOptions } from '..';
|
|
11
|
-
import { Authenticator } from '../authenticator';
|
|
12
|
-
export declare const useSignInForms: () => {
|
|
13
|
-
[authType: string]: React.ComponentType<{
|
|
14
|
-
authenticator: Authenticator;
|
|
15
|
-
}>;
|
|
16
|
-
};
|
|
17
|
-
export declare const useSignInButtons: (authenticators?: any[]) => React.CElement<{
|
|
18
|
-
key: number;
|
|
19
|
-
authenticator: any;
|
|
20
|
-
}, React.Component<{
|
|
21
|
-
key: number;
|
|
22
|
-
authenticator: any;
|
|
23
|
-
}, any, any>>[];
|
|
24
|
-
export declare const SignInPage: () => React.JSX.Element;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import React, { FunctionComponent } from 'react';
|
|
10
|
-
import { AuthOptions } from '..';
|
|
11
|
-
export declare const SignupPageContext: React.Context<{
|
|
12
|
-
[authType: string]: {
|
|
13
|
-
component: FunctionComponent<{
|
|
14
|
-
name: string;
|
|
15
|
-
}>;
|
|
16
|
-
};
|
|
17
|
-
}>;
|
|
18
|
-
export declare const SignupPageProvider: React.FC<{
|
|
19
|
-
authType: string;
|
|
20
|
-
component: FunctionComponent<{
|
|
21
|
-
name: string;
|
|
22
|
-
}>;
|
|
23
|
-
}>;
|
|
24
|
-
export declare const useSignUpForms: () => {
|
|
25
|
-
[authType: string]: React.ComponentType<{
|
|
26
|
-
authenticatorName: string;
|
|
27
|
-
}>;
|
|
28
|
-
};
|
|
29
|
-
export declare const SignUpPage: () => React.JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export * from './AuthLayout';
|
|
10
|
-
export * from './SignInPage';
|
|
11
|
-
export * from './SignUpPage';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
export declare const Authenticator: () => React.JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
export declare const useValuesFromOptions: (options: any) => import("@nocobase/client").UseRequestResult<unknown>;
|
|
11
|
-
export declare const useAdminSettingsForm: (authType: string) => any;
|
|
12
|
-
export declare const Options: React.MemoExoticComponent<import("@formily/react").ReactFC<unknown>>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
/// <reference types="react" />
|
|
10
|
-
export declare const AuthTypeContext: import("react").Context<{
|
|
11
|
-
type: string;
|
|
12
|
-
}>;
|
|
13
|
-
export declare const AuthTypesContext: import("react").Context<{
|
|
14
|
-
types: {
|
|
15
|
-
key: string;
|
|
16
|
-
label: string;
|
|
17
|
-
value: string;
|
|
18
|
-
}[];
|
|
19
|
-
}>;
|
|
20
|
-
export declare const useAuthTypes: () => {
|
|
21
|
-
key: string;
|
|
22
|
-
label: string;
|
|
23
|
-
value: string;
|
|
24
|
-
}[];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { ISchema } from '@formily/react';
|
|
10
|
-
export declare const createFormSchema: ISchema;
|
|
11
|
-
export declare const authenticatorsSchema: ISchema;
|
package/dist/externalVersion.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.2.13-alpha",
|
|
12
|
-
"react": "18.2.0",
|
|
13
|
-
"react-router-dom": "6.21.0",
|
|
14
|
-
"@nocobase/utils": "1.2.13-alpha",
|
|
15
|
-
"@nocobase/auth": "1.2.13-alpha",
|
|
16
|
-
"@nocobase/database": "1.2.13-alpha",
|
|
17
|
-
"@nocobase/cache": "1.2.13-alpha",
|
|
18
|
-
"@nocobase/server": "1.2.13-alpha",
|
|
19
|
-
"@nocobase/test": "1.2.13-alpha",
|
|
20
|
-
"antd": "5.12.8",
|
|
21
|
-
"@formily/react": "2.3.0",
|
|
22
|
-
"@formily/shared": "2.3.0",
|
|
23
|
-
"react-i18next": "11.18.6",
|
|
24
|
-
"@emotion/css": "11.11.2",
|
|
25
|
-
"@ant-design/icons": "5.2.6",
|
|
26
|
-
"@nocobase/actions": "1.2.13-alpha"
|
|
27
|
-
};
|
package/dist/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export { AuthModel, BasicAuth, default } from './server';
|
package/dist/index.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var src_exports = {};
|
|
38
|
-
__export(src_exports, {
|
|
39
|
-
AuthModel: () => import_server.AuthModel,
|
|
40
|
-
BasicAuth: () => import_server.BasicAuth,
|
|
41
|
-
default: () => import_server.default
|
|
42
|
-
});
|
|
43
|
-
module.exports = __toCommonJS(src_exports);
|
|
44
|
-
var import_server = __toESM(require("./server"));
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
AuthModel,
|
|
48
|
-
BasicAuth
|
|
49
|
-
});
|
package/dist/locale/en-US.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Auth Type": "Auth Type",
|
|
3
|
-
"Authenticators": "Authenticators",
|
|
4
|
-
"Authentication": "Authentication",
|
|
5
|
-
"Sign in via email": "Sign in via email",
|
|
6
|
-
"Sign in via password": "Sign in via password",
|
|
7
|
-
"Not allowed to sign up": "Not allowed to sign up",
|
|
8
|
-
"Allow to sign up": "Allow to sign up",
|
|
9
|
-
"The username or email is incorrect, please re-enter": "The username or email is incorrect, please re-enter",
|
|
10
|
-
"The password is incorrect, please re-enter": "The password is incorrect, please re-enter",
|
|
11
|
-
"Not a valid cellphone number, please re-enter": "Not a valid cellphone number, please re-enter",
|
|
12
|
-
"The phone number has been registered, please login directly": "The phone number has been registered, please login directly",
|
|
13
|
-
"The phone number is not registered, please register first": "The phone number is not registered, please register first",
|
|
14
|
-
"Please keep and enable at least one authenticator": "Please keep and enable at least one authenticator",
|
|
15
|
-
"Allow to sign in with": "Allow to sign in with",
|
|
16
|
-
"Please enter a valid username": "Please enter a valid username",
|
|
17
|
-
"Please enter a valid email": "Please enter a valid email",
|
|
18
|
-
"Please enter your username or email": "Please enter your username or email",
|
|
19
|
-
"Please enter a password": "Please enter a password",
|
|
20
|
-
"Username/Email": "Username/Email",
|
|
21
|
-
"Auth UID": "Auth UID",
|
|
22
|
-
"The authentication allows users to sign in via username or email.": "The authentication allows users to sign in via username or email.",
|
|
23
|
-
"No authentication methods available.": "No authentication methods available.",
|
|
24
|
-
"The password is inconsistent, please re-enter": "The password is inconsistent, please re-enter",
|
|
25
|
-
"Sign-in": "Sign-in",
|
|
26
|
-
"Password": "Password"
|
|
27
|
-
}
|
package/dist/locale/ko_KR.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Auth Type": "인증 유형",
|
|
3
|
-
"Authenticators": "인증기",
|
|
4
|
-
"Authentication": "인증",
|
|
5
|
-
"Sign in via email": "이메일로 로그인",
|
|
6
|
-
"Sign in via password": "비밀번호로 로그인",
|
|
7
|
-
"Not allowed to sign up": "가입할 수 없음",
|
|
8
|
-
"Allow to sign up": "가입 허용",
|
|
9
|
-
"The username or email is incorrect, please re-enter": "사용자 이름 또는 이메일이 잘못되었습니다. 다시 입력하세요.",
|
|
10
|
-
"The password is incorrect, please re-enter": "비밀번호가 잘못되었습니다. 다시 입력하세요.",
|
|
11
|
-
"Not a valid cellphone number, please re-enter": "유효하지 않은 휴대폰 번호입니다. 다시 입력하세요.",
|
|
12
|
-
"The phone number has been registered, please login directly": "전화번호가 이미 등록되어 있습니다. 직접 로그인하세요.",
|
|
13
|
-
"The phone number is not registered, please register first": "전화번호가 등록되어 있지 않습니다. 먼저 등록하세요.",
|
|
14
|
-
"Please keep and enable at least one authenticator": "최소한 하나의 인증기를 유지하고 활성화하세요.",
|
|
15
|
-
"Allow to sign in with": "다음으로 로그인 허용",
|
|
16
|
-
"Please enter a valid username": "유효한 사용자 이름을 입력하세요.",
|
|
17
|
-
"Please enter a valid email": "유효한 이메일을 입력하세요.",
|
|
18
|
-
"Please enter your username or email": "사용자 이름 또는 이메일을 입력하세요.",
|
|
19
|
-
"SMS": "SMS",
|
|
20
|
-
"Username/Email": "사용자 이름/이메일",
|
|
21
|
-
"Auth UID": "인증 UID",
|
|
22
|
-
"The authentication allows users to sign in via username or email.": "이 인증 방식을 사용하면 사용자가 사용자 이름 또는 이메일로 로그인할 수 있습니다.",
|
|
23
|
-
"No authentication methods available.": "사용 가능한 인증 방법이 없습니다.",
|
|
24
|
-
"The password is inconsistent, please re-enter": "비밀번호가 일치하지 않습니다. 다시 입력하세요.",
|
|
25
|
-
"Sign-in": "로그인"
|
|
26
|
-
}
|
package/dist/locale/zh-CN.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Auth Type": "认证类型",
|
|
3
|
-
"Authenticators": "认证器",
|
|
4
|
-
"Authentication": "用户认证",
|
|
5
|
-
"Sign in via email": "邮箱登录",
|
|
6
|
-
"Sign in via password": "密码登录",
|
|
7
|
-
"Not allowed to sign up": "禁止注册",
|
|
8
|
-
"Allow to sign up": "允许注册",
|
|
9
|
-
"The username or email is incorrect, please re-enter": "用户名或邮箱有误,请重新输入",
|
|
10
|
-
"The password is incorrect, please re-enter": "密码有误,请重新输入",
|
|
11
|
-
"Not a valid cellphone number, please re-enter": "不是有效的手机号,请重新输入",
|
|
12
|
-
"The phone number has been registered, please login directly": "手机号已注册,请直接登录",
|
|
13
|
-
"The phone number is not registered, please register first": "手机号未注册,请先注册",
|
|
14
|
-
"Please keep and enable at least one authenticator": "请至少保留并启用一个认证器",
|
|
15
|
-
"Allow to sign in with": "允许使用以下方式登录",
|
|
16
|
-
"Please enter a valid username": "请输入有效的用户名",
|
|
17
|
-
"Please enter a valid email": "请输入有效的邮箱",
|
|
18
|
-
"Please enter your username or email": "请输入用户名或邮箱",
|
|
19
|
-
"Please enter a password": "请输入密码",
|
|
20
|
-
"Username/Email": "用户名/邮箱",
|
|
21
|
-
"Auth UID": "认证标识",
|
|
22
|
-
"The authentication allows users to sign in via username or email.": "该认证方式支持用户通过用户名或邮箱登录。",
|
|
23
|
-
"No authentication methods available.": "没有可用的认证方式。",
|
|
24
|
-
"The password is inconsistent, please re-enter": "密码不一致,请重新输入",
|
|
25
|
-
"Sign-in": "登录",
|
|
26
|
-
"Password": "密码"
|
|
27
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
Copyright © 2017 Nicholas Campbell <nicholas.j.campbell@gmail.com>
|
|
3
|
-
|
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
|
-
|
|
6
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|