@tachybase/plugin-auth-cas 1.6.0 → 1.6.3
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/README.md +0 -1
- package/README.zh-CN.md +0 -1
- package/dist/externalVersion.js +5 -5
- package/dist/server/actions/login.js +2 -2
- package/dist/server/actions/service.js +1 -1
- package/dist/server/auth.js +2 -1
- package/dist/server/collections/.gitkeep +0 -0
- package/dist/server/plugin.js +1 -1
- package/package.json +7 -7
- package/src/server/actions/login.ts +2 -2
- package/src/server/actions/service.ts +1 -1
- package/src/server/auth.ts +2 -1
- package/src/server/plugin.ts +1 -1
package/README.md
CHANGED
package/README.zh-CN.md
CHANGED
package/dist/externalVersion.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "1.6.
|
|
3
|
+
"@tachybase/client": "1.6.3",
|
|
4
4
|
"antd": "5.22.5",
|
|
5
|
-
"@tachybase/module-auth": "1.6.
|
|
6
|
-
"@ant-design/icons": "
|
|
7
|
-
"@tego/client": "1.
|
|
5
|
+
"@tachybase/module-auth": "1.6.3",
|
|
6
|
+
"@ant-design/icons": "6.1.0",
|
|
7
|
+
"@tego/client": "1.6.1",
|
|
8
8
|
"react-router-dom": "6.28.1",
|
|
9
|
-
"@tego/server": "1.
|
|
9
|
+
"@tego/server": "1.6.1",
|
|
10
10
|
"axios": "1.13.0",
|
|
11
11
|
"react-i18next": "16.2.1"
|
|
12
12
|
};
|
|
@@ -22,9 +22,9 @@ __export(login_exports, {
|
|
|
22
22
|
module.exports = __toCommonJS(login_exports);
|
|
23
23
|
const login = async (ctx, next) => {
|
|
24
24
|
const { authenticator, redirect = "/admin" } = ctx.action.params;
|
|
25
|
-
const auth = await ctx.
|
|
25
|
+
const auth = await ctx.tego.authManager.get(authenticator, ctx);
|
|
26
26
|
const { casUrl } = auth.getOptions();
|
|
27
|
-
const service = auth.getService(authenticator, ctx.
|
|
27
|
+
const service = auth.getService(authenticator, ctx.tego.name, redirect);
|
|
28
28
|
ctx.redirect(`${casUrl}/login?service=${service}`);
|
|
29
29
|
next();
|
|
30
30
|
};
|
|
@@ -30,7 +30,7 @@ const service = async (ctx, next) => {
|
|
|
30
30
|
prefix += `apps/${appName}`;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
const auth = await ctx.
|
|
33
|
+
const auth = await ctx.tego.authManager.get(authenticator, ctx);
|
|
34
34
|
if (prefix.endsWith("/")) {
|
|
35
35
|
prefix = prefix.slice(0, -1);
|
|
36
36
|
}
|
package/dist/server/auth.js
CHANGED
|
@@ -37,7 +37,8 @@ class CASAuth extends import_server.BaseAuth {
|
|
|
37
37
|
const { ctx } = config;
|
|
38
38
|
super({
|
|
39
39
|
...config,
|
|
40
|
-
userCollection: ctx.db.getCollection("users")
|
|
40
|
+
userCollection: ctx.db.getCollection("users"),
|
|
41
|
+
userStatusCollection: ctx.db.getCollection("userStatuses")
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
getOptions() {
|
|
File without changes
|
package/dist/server/plugin.js
CHANGED
|
@@ -35,7 +35,7 @@ class CasPlugin extends import_server.Plugin {
|
|
|
35
35
|
this.app.authManager.registerTypes(import_constants.authType, {
|
|
36
36
|
auth: import_auth.CASAuth
|
|
37
37
|
});
|
|
38
|
-
this.app.
|
|
38
|
+
this.app.resourcer.define({
|
|
39
39
|
name: "cas",
|
|
40
40
|
actions: {
|
|
41
41
|
service: import_service.service,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-auth-cas",
|
|
3
3
|
"displayName": "Auth: CAS",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.3",
|
|
5
5
|
"description": "CAS authentication.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Authentication"
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"main": "./dist/server/index.js",
|
|
11
11
|
"dependencies": {},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@ant-design/icons": "^
|
|
14
|
-
"@tachybase/test": "1.
|
|
15
|
-
"@tego/client": "1.
|
|
16
|
-
"@tego/server": "1.
|
|
13
|
+
"@ant-design/icons": "^6.1.0",
|
|
14
|
+
"@tachybase/test": "1.6.1",
|
|
15
|
+
"@tego/client": "1.6.1",
|
|
16
|
+
"@tego/server": "1.6.1",
|
|
17
17
|
"antd": "5.22.5",
|
|
18
18
|
"axios": "1.13.0",
|
|
19
19
|
"react-i18next": "16.2.1",
|
|
20
20
|
"react-router-dom": "6.28.1",
|
|
21
|
-
"@tachybase/
|
|
22
|
-
"@tachybase/
|
|
21
|
+
"@tachybase/module-auth": "1.6.3",
|
|
22
|
+
"@tachybase/client": "1.6.3"
|
|
23
23
|
},
|
|
24
24
|
"description.zh-CN": "通过 CAS 协议认证身份。",
|
|
25
25
|
"displayName.zh-CN": "认证:CAS",
|
|
@@ -4,9 +4,9 @@ import { CASAuth } from '../auth';
|
|
|
4
4
|
|
|
5
5
|
export const login = async (ctx: Context, next: Next) => {
|
|
6
6
|
const { authenticator, redirect = '/admin' } = ctx.action.params;
|
|
7
|
-
const auth = (await ctx.
|
|
7
|
+
const auth = (await ctx.tego.authManager.get(authenticator, ctx)) as CASAuth;
|
|
8
8
|
const { casUrl } = auth.getOptions();
|
|
9
|
-
const service = auth.getService(authenticator, ctx.
|
|
9
|
+
const service = auth.getService(authenticator, ctx.tego.name, redirect);
|
|
10
10
|
ctx.redirect(`${casUrl}/login?service=${service}`);
|
|
11
11
|
next();
|
|
12
12
|
};
|
|
@@ -13,7 +13,7 @@ export const service = async (ctx: Context, next: Next) => {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
const auth = (await ctx.
|
|
16
|
+
const auth = (await ctx.tego.authManager.get(authenticator, ctx)) as CASAuth;
|
|
17
17
|
|
|
18
18
|
if (prefix.endsWith('/')) {
|
|
19
19
|
prefix = prefix.slice(0, -1);
|
package/src/server/auth.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuthModel } from '@tachybase/module-auth';
|
|
2
|
-
|
|
3
2
|
import { AuthConfig, BaseAuth, Model } from '@tego/server';
|
|
3
|
+
|
|
4
4
|
import axios from 'axios';
|
|
5
5
|
|
|
6
6
|
export class CASAuth extends BaseAuth {
|
|
@@ -9,6 +9,7 @@ export class CASAuth extends BaseAuth {
|
|
|
9
9
|
super({
|
|
10
10
|
...config,
|
|
11
11
|
userCollection: ctx.db.getCollection('users'),
|
|
12
|
+
userStatusCollection: ctx.db.getCollection('userStatuses'),
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
15
|
|