@nocobase/plugin-auth 0.10.1-alpha.1 → 0.11.1-alpha.1
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/client.d.ts +2 -3
- package/lib/client/AuthProvider.d.ts +2 -0
- package/lib/client/AuthProvider.js +56 -0
- package/lib/client/index.d.ts +5 -3
- package/lib/client/index.js +13 -42
- package/lib/client/settings/Options.d.ts +14 -1
- package/lib/client/settings/Options.js +10 -10
- package/lib/client/settings/schemas/authenticators.js +7 -7
- package/lib/server/collections/authenticators.d.ts +1 -1
- package/lib/server/collections/authenticators.js +2 -1
- package/lib/server/collections/users-authenticators.d.ts +1 -1
- package/package.json +27 -9
- package/server.d.ts +2 -3
- package/src/client/AuthProvider.tsx +41 -0
- package/src/client/basic/SigninPage.tsx +1 -1
- package/src/client/index.tsx +9 -40
- package/src/client/settings/Options.tsx +2 -3
- package/src/client/settings/schemas/authenticators.ts +3 -3
- package/src/server/actions/authenticators.ts +2 -2
- package/src/server/collections/authenticators.ts +1 -0
package/client.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export { default } from './lib/client';
|
|
1
|
+
export * from './src/client';
|
|
2
|
+
export { default } from './src/client';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AuthProvider = void 0;
|
|
7
|
+
function _client() {
|
|
8
|
+
const data = require("@nocobase/client");
|
|
9
|
+
_client = function _client() {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _react() {
|
|
15
|
+
const data = _interopRequireDefault(require("react"));
|
|
16
|
+
_react = function _react() {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
var _Authenticator = require("./settings/Authenticator");
|
|
22
|
+
var _SigninPage = _interopRequireDefault(require("./basic/SigninPage"));
|
|
23
|
+
var _preset = require("../preset");
|
|
24
|
+
var _SignupPage = _interopRequireDefault(require("./basic/SignupPage"));
|
|
25
|
+
var _locale = require("./locale");
|
|
26
|
+
var _Options = require("./basic/Options");
|
|
27
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
|
+
const AuthProvider = props => {
|
|
29
|
+
const _useAuthTranslation = (0, _locale.useAuthTranslation)(),
|
|
30
|
+
t = _useAuthTranslation.t;
|
|
31
|
+
return _react().default.createElement(_client().SettingsCenterProvider, {
|
|
32
|
+
settings: {
|
|
33
|
+
auth: {
|
|
34
|
+
title: t('Authentication'),
|
|
35
|
+
icon: 'LoginOutlined',
|
|
36
|
+
tabs: {
|
|
37
|
+
authenticators: {
|
|
38
|
+
title: t('Authenticators'),
|
|
39
|
+
component: () => _react().default.createElement(_Authenticator.Authenticator, null)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}, _react().default.createElement(_client().OptionsComponentProvider, {
|
|
45
|
+
authType: _preset.presetAuthType,
|
|
46
|
+
component: _Options.Options
|
|
47
|
+
}, _react().default.createElement(_client().SigninPageProvider, {
|
|
48
|
+
authType: _preset.presetAuthType,
|
|
49
|
+
tabTitle: t('Sign in via email'),
|
|
50
|
+
component: _SigninPage.default
|
|
51
|
+
}, _react().default.createElement(_client().SignupPageProvider, {
|
|
52
|
+
authType: _preset.presetAuthType,
|
|
53
|
+
component: _SignupPage.default
|
|
54
|
+
}, props.children))));
|
|
55
|
+
};
|
|
56
|
+
exports.AuthProvider = AuthProvider;
|
package/lib/client/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare
|
|
3
|
-
|
|
1
|
+
import { Plugin } from '@nocobase/client';
|
|
2
|
+
export declare class AuthPlugin extends Plugin {
|
|
3
|
+
load(): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
export default AuthPlugin;
|
package/lib/client/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.AuthPlugin = void 0;
|
|
7
7
|
function _client() {
|
|
8
8
|
const data = require("@nocobase/client");
|
|
9
9
|
_client = function _client() {
|
|
@@ -11,46 +11,17 @@ function _client() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
var _AuthProvider = require("./AuthProvider");
|
|
15
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
16
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
17
|
+
class AuthPlugin extends _client().Plugin {
|
|
18
|
+
load() {
|
|
19
|
+
var _this = this;
|
|
20
|
+
return _asyncToGenerator(function* () {
|
|
21
|
+
_this.app.use(_AuthProvider.AuthProvider);
|
|
22
|
+
})();
|
|
23
|
+
}
|
|
20
24
|
}
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
var _preset = require("../preset");
|
|
24
|
-
var _SignupPage = _interopRequireDefault(require("./basic/SignupPage"));
|
|
25
|
-
var _locale = require("./locale");
|
|
26
|
-
var _Options = require("./basic/Options");
|
|
27
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
|
-
var _default = props => {
|
|
29
|
-
const _useAuthTranslation = (0, _locale.useAuthTranslation)(),
|
|
30
|
-
t = _useAuthTranslation.t;
|
|
31
|
-
return _react().default.createElement(_client().SettingsCenterProvider, {
|
|
32
|
-
settings: {
|
|
33
|
-
auth: {
|
|
34
|
-
title: t('Authentication'),
|
|
35
|
-
icon: 'LoginOutlined',
|
|
36
|
-
tabs: {
|
|
37
|
-
authenticators: {
|
|
38
|
-
title: t('Authenticators'),
|
|
39
|
-
component: () => _react().default.createElement(_Authenticator.Authenticator, null)
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}, _react().default.createElement(_client().OptionsComponentProvider, {
|
|
45
|
-
authType: _preset.presetAuthType,
|
|
46
|
-
component: _Options.Options
|
|
47
|
-
}, _react().default.createElement(_client().SigninPageProvider, {
|
|
48
|
-
authType: _preset.presetAuthType,
|
|
49
|
-
tabTitle: t('Sign in via email'),
|
|
50
|
-
component: _SigninPage.default
|
|
51
|
-
}, _react().default.createElement(_client().SignupPageProvider, {
|
|
52
|
-
authType: _preset.presetAuthType,
|
|
53
|
-
component: _SignupPage.default
|
|
54
|
-
}, props.children))));
|
|
55
|
-
};
|
|
25
|
+
exports.AuthPlugin = AuthPlugin;
|
|
26
|
+
var _default = AuthPlugin;
|
|
56
27
|
exports.default = _default;
|
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const useValuesFromOptions: (options: any) =>
|
|
2
|
+
export declare const useValuesFromOptions: (options: any) => {
|
|
3
|
+
state: {};
|
|
4
|
+
setState: import("ahooks/lib/useSetState").SetState<{}>;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
data?: unknown;
|
|
7
|
+
error?: Error;
|
|
8
|
+
params: any;
|
|
9
|
+
cancel: () => void;
|
|
10
|
+
refresh: () => void;
|
|
11
|
+
refreshAsync: () => Promise<unknown>;
|
|
12
|
+
run: (...params: any) => void;
|
|
13
|
+
runAsync: (...params: any) => Promise<unknown>;
|
|
14
|
+
mutate: (data?: unknown) => void;
|
|
15
|
+
};
|
|
3
16
|
export declare const Options: import("react").MemoExoticComponent<import("@formily/react").ReactFC<unknown>>;
|
|
@@ -4,22 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useValuesFromOptions = exports.Options = void 0;
|
|
7
|
-
function
|
|
8
|
-
const data = require("@
|
|
9
|
-
|
|
7
|
+
function _react() {
|
|
8
|
+
const data = require("@formily/react");
|
|
9
|
+
_react = function _react() {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const data = require("
|
|
16
|
-
|
|
14
|
+
function _client() {
|
|
15
|
+
const data = require("@nocobase/client");
|
|
16
|
+
_client = function _client() {
|
|
17
17
|
return data;
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
21
|
function _react2() {
|
|
22
|
-
const data = require("
|
|
22
|
+
const data = require("react");
|
|
23
23
|
_react2 = function _react2() {
|
|
24
24
|
return data;
|
|
25
25
|
};
|
|
@@ -39,7 +39,7 @@ const useValuesFromOptions = options => {
|
|
|
39
39
|
}));
|
|
40
40
|
const run = result.run;
|
|
41
41
|
const ctx = (0, _client().useActionContext)();
|
|
42
|
-
(0,
|
|
42
|
+
(0, _react2().useEffect)(() => {
|
|
43
43
|
if (ctx.visible) {
|
|
44
44
|
run();
|
|
45
45
|
}
|
|
@@ -47,8 +47,8 @@ const useValuesFromOptions = options => {
|
|
|
47
47
|
return result;
|
|
48
48
|
};
|
|
49
49
|
exports.useValuesFromOptions = useValuesFromOptions;
|
|
50
|
-
const Options = (0,
|
|
51
|
-
const form = (0,
|
|
50
|
+
const Options = (0, _react().observer)(() => {
|
|
51
|
+
const form = (0, _react().useForm)();
|
|
52
52
|
const record = (0, _client().useRecord)();
|
|
53
53
|
const component = (0, _client().useOptionsComponent)(form.values.authType || record.authType);
|
|
54
54
|
return component;
|
|
@@ -18,17 +18,16 @@ function _client() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const data = require("
|
|
23
|
-
|
|
21
|
+
function _antd() {
|
|
22
|
+
const data = require("antd");
|
|
23
|
+
_antd = function _antd() {
|
|
24
24
|
return data;
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
_antd = function _antd() {
|
|
28
|
+
function _react() {
|
|
29
|
+
const data = require("react");
|
|
30
|
+
_react = function _react() {
|
|
32
31
|
return data;
|
|
33
32
|
};
|
|
34
33
|
return data;
|
|
@@ -40,6 +39,7 @@ function _reactI18next() {
|
|
|
40
39
|
};
|
|
41
40
|
return data;
|
|
42
41
|
}
|
|
42
|
+
var _authType = require("../authType");
|
|
43
43
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
44
44
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
45
45
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CollectionOptions } from '@nocobase/database';
|
|
2
|
-
declare const _default: CollectionOptions;
|
|
3
2
|
/**
|
|
4
3
|
* Collection for user information of extended authentication methods,
|
|
5
4
|
* such as saml, oicd, oauth, sms, etc.
|
|
6
5
|
*/
|
|
6
|
+
declare const _default: CollectionOptions;
|
|
7
7
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-auth",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"main": "lib/server/index.js",
|
|
3
|
+
"version": "0.11.1-alpha.1",
|
|
4
|
+
"main": "./lib/server/index.js",
|
|
5
|
+
"files": [
|
|
6
|
+
"lib",
|
|
7
|
+
"src",
|
|
8
|
+
"README.md",
|
|
9
|
+
"README.zh-CN.md",
|
|
10
|
+
"CHANGELOG.md",
|
|
11
|
+
"server.js",
|
|
12
|
+
"server.d.ts",
|
|
13
|
+
"client.js",
|
|
14
|
+
"client.d.ts"
|
|
15
|
+
],
|
|
5
16
|
"devDependencies": {
|
|
6
|
-
"@
|
|
7
|
-
"@
|
|
17
|
+
"@ant-design/icons": "^5.1.4",
|
|
18
|
+
"@formily/react": "2.2.26",
|
|
19
|
+
"@formily/shared": "2.2.26",
|
|
20
|
+
"@nocobase/auth": "0.11.1-alpha.1",
|
|
21
|
+
"@nocobase/test": "0.11.1-alpha.1",
|
|
22
|
+
"@types/cron": "^2.0.1",
|
|
23
|
+
"antd": "^5.6.4",
|
|
24
|
+
"react": "^18.2.0",
|
|
25
|
+
"react-i18next": "^11.15.1"
|
|
8
26
|
},
|
|
9
27
|
"dependencies": {
|
|
10
|
-
"@nocobase/actions": "0.
|
|
11
|
-
"@nocobase/client": "0.
|
|
12
|
-
"@nocobase/database": "0.
|
|
13
|
-
"@nocobase/server": "0.
|
|
28
|
+
"@nocobase/actions": "0.11.1-alpha.1",
|
|
29
|
+
"@nocobase/client": "0.11.1-alpha.1",
|
|
30
|
+
"@nocobase/database": "0.11.1-alpha.1",
|
|
31
|
+
"@nocobase/server": "0.11.1-alpha.1",
|
|
14
32
|
"cron": "^2.3.1"
|
|
15
33
|
},
|
|
16
34
|
"displayName": "Authentication",
|
|
17
35
|
"displayName.zh-CN": "用户认证",
|
|
18
36
|
"description": "Basic authentication and authenticator management.",
|
|
19
37
|
"description.zh-CN": "提供基础认证功能和扩展认证器管理功能。",
|
|
20
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "9ed1dba520bc5f3a7cb1255ea8d92ccbefc11bc8"
|
|
21
39
|
}
|
package/server.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export { default } from './lib/server';
|
|
1
|
+
export * from './src/server';
|
|
2
|
+
export { default } from './src/server';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OptionsComponentProvider,
|
|
3
|
+
SettingsCenterProvider,
|
|
4
|
+
SigninPageProvider,
|
|
5
|
+
SignupPageProvider,
|
|
6
|
+
} from '@nocobase/client';
|
|
7
|
+
import React, { FC } from 'react';
|
|
8
|
+
import { Authenticator } from './settings/Authenticator';
|
|
9
|
+
import SigninPage from './basic/SigninPage';
|
|
10
|
+
import { presetAuthType } from '../preset';
|
|
11
|
+
import SignupPage from './basic/SignupPage';
|
|
12
|
+
import { useAuthTranslation } from './locale';
|
|
13
|
+
import { Options } from './basic/Options';
|
|
14
|
+
|
|
15
|
+
export const AuthProvider: FC = (props) => {
|
|
16
|
+
const { t } = useAuthTranslation();
|
|
17
|
+
return (
|
|
18
|
+
<SettingsCenterProvider
|
|
19
|
+
settings={{
|
|
20
|
+
auth: {
|
|
21
|
+
title: t('Authentication'),
|
|
22
|
+
icon: 'LoginOutlined',
|
|
23
|
+
tabs: {
|
|
24
|
+
authenticators: {
|
|
25
|
+
title: t('Authenticators'),
|
|
26
|
+
component: () => <Authenticator />,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
<OptionsComponentProvider authType={presetAuthType} component={Options}>
|
|
33
|
+
<SigninPageProvider authType={presetAuthType} tabTitle={t('Sign in via email')} component={SigninPage}>
|
|
34
|
+
<SignupPageProvider authType={presetAuthType} component={SignupPage}>
|
|
35
|
+
{props.children}
|
|
36
|
+
</SignupPageProvider>
|
|
37
|
+
</SigninPageProvider>
|
|
38
|
+
</OptionsComponentProvider>
|
|
39
|
+
</SettingsCenterProvider>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Authenticator, SchemaComponent, SignupPageContext, useSignIn } from '@nocobase/client';
|
|
2
1
|
import { ISchema } from '@formily/react';
|
|
2
|
+
import { Authenticator, SchemaComponent, SignupPageContext, useSignIn } from '@nocobase/client';
|
|
3
3
|
import React, { useContext } from 'react';
|
|
4
4
|
|
|
5
5
|
const passwordForm: ISchema = {
|
package/src/client/index.tsx
CHANGED
|
@@ -1,41 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
SettingsCenterProvider,
|
|
4
|
-
SigninPageProvider,
|
|
5
|
-
SignupPageProvider,
|
|
6
|
-
} from '@nocobase/client';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { Authenticator } from './settings/Authenticator';
|
|
9
|
-
import SigninPage from './basic/SigninPage';
|
|
10
|
-
import { presetAuthType } from '../preset';
|
|
11
|
-
import SignupPage from './basic/SignupPage';
|
|
12
|
-
import { useAuthTranslation } from './locale';
|
|
13
|
-
import { Options } from './basic/Options';
|
|
1
|
+
import { Plugin } from '@nocobase/client';
|
|
2
|
+
import { AuthProvider } from './AuthProvider';
|
|
14
3
|
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
icon: 'LoginOutlined',
|
|
23
|
-
tabs: {
|
|
24
|
-
authenticators: {
|
|
25
|
-
title: t('Authenticators'),
|
|
26
|
-
component: () => <Authenticator />,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
}}
|
|
31
|
-
>
|
|
32
|
-
<OptionsComponentProvider authType={presetAuthType} component={Options}>
|
|
33
|
-
<SigninPageProvider authType={presetAuthType} tabTitle={t('Sign in via email')} component={SigninPage}>
|
|
34
|
-
<SignupPageProvider authType={presetAuthType} component={SignupPage}>
|
|
35
|
-
{props.children}
|
|
36
|
-
</SignupPageProvider>
|
|
37
|
-
</SigninPageProvider>
|
|
38
|
-
</OptionsComponentProvider>
|
|
39
|
-
</SettingsCenterProvider>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
4
|
+
export class AuthPlugin extends Plugin {
|
|
5
|
+
async load() {
|
|
6
|
+
this.app.use(AuthProvider);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default AuthPlugin;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { useRequest, useRecord, useActionContext } from '@nocobase/client';
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import { useOptionsComponent } from '@nocobase/client';
|
|
4
1
|
import { observer, useForm } from '@formily/react';
|
|
2
|
+
import { useActionContext, useOptionsComponent, useRecord, useRequest } from '@nocobase/client';
|
|
3
|
+
import { useEffect } from 'react';
|
|
5
4
|
|
|
6
5
|
export const useValuesFromOptions = (options) => {
|
|
7
6
|
const record = useRecord();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { uid } from '@formily/shared';
|
|
2
1
|
import { ISchema } from '@formily/react';
|
|
2
|
+
import { uid } from '@formily/shared';
|
|
3
3
|
import { useAPIClient, useActionContext, useRequest } from '@nocobase/client';
|
|
4
|
-
import { useContext } from 'react';
|
|
5
|
-
import { AuthTypeContext } from '../authType';
|
|
6
4
|
import { message } from 'antd';
|
|
5
|
+
import { useContext } from 'react';
|
|
7
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { AuthTypeContext } from '../authType';
|
|
8
8
|
|
|
9
9
|
const collection = {
|
|
10
10
|
name: 'authenticators',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Context, Next } from '@nocobase/actions';
|
|
2
|
-
import { namespace } from '../../preset';
|
|
3
2
|
import { Model, Repository } from '@nocobase/database';
|
|
3
|
+
import { namespace } from '../../preset';
|
|
4
4
|
|
|
5
|
-
async function checkCount(repository: Repository, id: number) {
|
|
5
|
+
async function checkCount(repository: Repository, id: number[]) {
|
|
6
6
|
// TODO(yangqia): This is a temporary solution, may cause concurrency problem.
|
|
7
7
|
const count = await repository.count({
|
|
8
8
|
filter: {
|