@nocobase/auth 1.6.0-alpha.1 → 1.6.0-alpha.11
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/auth.d.ts +4 -0
- package/lib/auth.js +6 -0
- package/lib/base/auth.js +3 -1
- package/package.json +7 -7
package/lib/auth.d.ts
CHANGED
|
@@ -25,6 +25,10 @@ interface IAuth {
|
|
|
25
25
|
signOut(): Promise<any>;
|
|
26
26
|
}
|
|
27
27
|
export declare abstract class Auth implements IAuth {
|
|
28
|
+
/**
|
|
29
|
+
* options keys that are not allowed to use environment variables
|
|
30
|
+
*/
|
|
31
|
+
static optionsKeysNotAllowedInEnv: string[];
|
|
28
32
|
abstract user: Model;
|
|
29
33
|
protected authenticator: Authenticator;
|
|
30
34
|
protected options: {
|
package/lib/auth.js
CHANGED
|
@@ -11,6 +11,7 @@ var __defProp = Object.defineProperty;
|
|
|
11
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
13
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
15
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
16
|
var __export = (target, all) => {
|
|
16
17
|
for (var name in all)
|
|
@@ -25,6 +26,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
25
26
|
return to;
|
|
26
27
|
};
|
|
27
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
28
30
|
var auth_exports = {};
|
|
29
31
|
__export(auth_exports, {
|
|
30
32
|
Auth: () => Auth
|
|
@@ -49,6 +51,10 @@ const _Auth = class _Auth {
|
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
53
|
__name(_Auth, "Auth");
|
|
54
|
+
/**
|
|
55
|
+
* options keys that are not allowed to use environment variables
|
|
56
|
+
*/
|
|
57
|
+
__publicField(_Auth, "optionsKeysNotAllowedInEnv");
|
|
52
58
|
let Auth = _Auth;
|
|
53
59
|
// Annotate the CommonJS export names for ESM import in node:
|
|
54
60
|
0 && (module.exports = {
|
package/lib/base/auth.js
CHANGED
|
@@ -102,7 +102,9 @@ const _BaseAuth = class _BaseAuth extends import_auth.Auth {
|
|
|
102
102
|
try {
|
|
103
103
|
user = await this.validate();
|
|
104
104
|
} catch (err) {
|
|
105
|
-
this.ctx.throw(err.status || 401, err.message
|
|
105
|
+
this.ctx.throw(err.status || 401, err.message, {
|
|
106
|
+
...err
|
|
107
|
+
});
|
|
106
108
|
}
|
|
107
109
|
if (!user) {
|
|
108
110
|
this.ctx.throw(401, "Unauthorized");
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/auth",
|
|
3
|
-
"version": "1.6.0-alpha.
|
|
3
|
+
"version": "1.6.0-alpha.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/actions": "1.6.0-alpha.
|
|
10
|
-
"@nocobase/cache": "1.6.0-alpha.
|
|
11
|
-
"@nocobase/database": "1.6.0-alpha.
|
|
12
|
-
"@nocobase/resourcer": "1.6.0-alpha.
|
|
13
|
-
"@nocobase/utils": "1.6.0-alpha.
|
|
9
|
+
"@nocobase/actions": "1.6.0-alpha.11",
|
|
10
|
+
"@nocobase/cache": "1.6.0-alpha.11",
|
|
11
|
+
"@nocobase/database": "1.6.0-alpha.11",
|
|
12
|
+
"@nocobase/resourcer": "1.6.0-alpha.11",
|
|
13
|
+
"@nocobase/utils": "1.6.0-alpha.11",
|
|
14
14
|
"@types/jsonwebtoken": "^8.5.8",
|
|
15
15
|
"jsonwebtoken": "^8.5.1"
|
|
16
16
|
},
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
20
20
|
"directory": "packages/auth"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "2a07f8a9af90b3ce09229cae72a485c14df2361b"
|
|
23
23
|
}
|