@nocobase/plugin-auth 0.11.0-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/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.js +2 -1
- package/package.json +8 -8
- package/src/client/basic/SigninPage.tsx +1 -1
- 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
|
@@ -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; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-auth",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1-alpha.1",
|
|
4
4
|
"main": "./lib/server/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -17,23 +17,23 @@
|
|
|
17
17
|
"@ant-design/icons": "^5.1.4",
|
|
18
18
|
"@formily/react": "2.2.26",
|
|
19
19
|
"@formily/shared": "2.2.26",
|
|
20
|
-
"@nocobase/auth": "0.11.
|
|
21
|
-
"@nocobase/test": "0.11.
|
|
20
|
+
"@nocobase/auth": "0.11.1-alpha.1",
|
|
21
|
+
"@nocobase/test": "0.11.1-alpha.1",
|
|
22
22
|
"@types/cron": "^2.0.1",
|
|
23
23
|
"antd": "^5.6.4",
|
|
24
24
|
"react": "^18.2.0",
|
|
25
25
|
"react-i18next": "^11.15.1"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@nocobase/actions": "0.11.
|
|
29
|
-
"@nocobase/client": "0.11.
|
|
30
|
-
"@nocobase/database": "0.11.
|
|
31
|
-
"@nocobase/server": "0.11.
|
|
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",
|
|
32
32
|
"cron": "^2.3.1"
|
|
33
33
|
},
|
|
34
34
|
"displayName": "Authentication",
|
|
35
35
|
"displayName.zh-CN": "用户认证",
|
|
36
36
|
"description": "Basic authentication and authenticator management.",
|
|
37
37
|
"description.zh-CN": "提供基础认证功能和扩展认证器管理功能。",
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "9ed1dba520bc5f3a7cb1255ea8d92ccbefc11bc8"
|
|
39
39
|
}
|
|
@@ -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 = {
|
|
@@ -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: {
|