@nocobase/auth 1.4.0-alpha → 1.4.0-alpha.0
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-manager.js +4 -3
- package/package.json +7 -7
package/lib/auth-manager.js
CHANGED
|
@@ -96,7 +96,8 @@ const _AuthManager = class _AuthManager {
|
|
|
96
96
|
* @description Auth middleware, used to check the authentication status.
|
|
97
97
|
*/
|
|
98
98
|
middleware() {
|
|
99
|
-
|
|
99
|
+
const self = this;
|
|
100
|
+
return /* @__PURE__ */ __name(async function AuthManagerMiddleware(ctx, next) {
|
|
100
101
|
var _a;
|
|
101
102
|
const token = ctx.getBearerToken();
|
|
102
103
|
if (token && await ((_a = ctx.app.authManager.jwt.blacklist) == null ? void 0 : _a.has(token))) {
|
|
@@ -105,7 +106,7 @@ const _AuthManager = class _AuthManager {
|
|
|
105
106
|
message: ctx.t("Token is invalid")
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
|
-
const name = ctx.get(
|
|
109
|
+
const name = ctx.get(self.options.authKey) || self.options.default;
|
|
109
110
|
let authenticator;
|
|
110
111
|
try {
|
|
111
112
|
authenticator = await ctx.app.authManager.get(name, ctx);
|
|
@@ -122,7 +123,7 @@ const _AuthManager = class _AuthManager {
|
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
await next();
|
|
125
|
-
};
|
|
126
|
+
}, "AuthManagerMiddleware");
|
|
126
127
|
}
|
|
127
128
|
};
|
|
128
129
|
__name(_AuthManager, "AuthManager");
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/auth",
|
|
3
|
-
"version": "1.4.0-alpha",
|
|
3
|
+
"version": "1.4.0-alpha.0",
|
|
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.4.0-alpha",
|
|
10
|
-
"@nocobase/cache": "1.4.0-alpha",
|
|
11
|
-
"@nocobase/database": "1.4.0-alpha",
|
|
12
|
-
"@nocobase/resourcer": "1.4.0-alpha",
|
|
13
|
-
"@nocobase/utils": "1.4.0-alpha",
|
|
9
|
+
"@nocobase/actions": "1.4.0-alpha.0",
|
|
10
|
+
"@nocobase/cache": "1.4.0-alpha.0",
|
|
11
|
+
"@nocobase/database": "1.4.0-alpha.0",
|
|
12
|
+
"@nocobase/resourcer": "1.4.0-alpha.0",
|
|
13
|
+
"@nocobase/utils": "1.4.0-alpha.0",
|
|
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": "8ffa7b54bbaf720c0c9857da4b19a99110dffc4b"
|
|
23
23
|
}
|