@tachybase/plugin-auth-cas 1.3.20 → 1.3.22
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/dist/client/index.js +1 -1
- package/dist/externalVersion.js +6 -9
- package/dist/server/actions/login.d.ts +1 -1
- package/dist/server/actions/service.d.ts +1 -1
- package/dist/server/actions/service.js +1 -1
- package/dist/server/auth.d.ts +1 -2
- package/dist/server/auth.js +2 -2
- package/dist/server/plugin.d.ts +1 -1
- package/dist/server/plugin.js +1 -1
- package/package.json +10 -17
- package/src/client/SigninPage.tsx +1 -1
- package/src/server/actions/login.ts +1 -1
- package/src/server/actions/service.ts +1 -2
- package/src/server/auth.ts +1 -2
- package/src/server/plugin.ts +1 -1
package/dist/client/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@tachybase/client"),require("@tachybase/module-auth/client"),require("react/jsx-runtime"),require("antd"),require("react-i18next"),require("react"),require("@
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@tachybase/client"),require("@tachybase/module-auth/client"),require("react/jsx-runtime"),require("antd"),require("react-i18next"),require("react"),require("@ant-design/icons"),require("@tego/client"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/module-auth/client","react/jsx-runtime","antd","react-i18next","react","@ant-design/icons","@tego/client","react-router-dom"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e["@tachybase/plugin-auth-cas"]={},e["@tachybase/client"],e["@tachybase/module-auth"],e.jsxRuntime,e.antd,e["react-i18next"],e.react,e["@ant-design/icons"],e["@tego/client"],e["react-router-dom"]))})(this,function(e,t,o,a,r,p,d,i,n,s){"use strict";var m=(e,t,o)=>new Promise((a,r)=>{var p=n=>{try{i(o.next(n))}catch(s){r(s)}},d=n=>{try{i(o.throw(n))}catch(s){r(s)}},i=n=>n.done?a(n.value):Promise.resolve(n.value).then(p,d);i((o=o.apply(e,t)).next())});const g="CAS",h="cas";function x(){return p.useTranslation(h)}function S(c){return`{{t('${c}', { ns: '${h}', nsMode: 'fallback' })}}`}const q=()=>{const{t:c}=x();return a.jsx(t.SchemaComponent,{scope:{t:c},components:{Space:r.Space},schema:{type:"object",properties:{autoSignup:{"x-decorator":"FormItem",type:"boolean",title:'{{t("Sign up automatically when the user does not exist")}}',"x-component":"Checkbox"},casUrl:{title:'{{t("CAS URL")}}',"x-component":"Input","x-decorator":"FormItem",required:!0},serviceDomain:{title:'{{t("Service domain")}}',"x-component":"Input","x-decorator":"FormItem","x-decorator-props":{tooltip:S("The domain is usually the address of your server, in local development, you can use the address of your local machine, such as: http://localhost:3000")},required:!0}}}})},P=c=>{const u=c.authenticator,T=s.useLocation(),l=new URLSearchParams(T.search),b=l.get("redirect"),A=t.useApp(),j=n.getSubAppName(A.getPublicPath())||"main",v=()=>m(null,null,function*(){window.location.replace(`/api/cas:login?authenticator=${u.name}&__appName=${j}&redirect=${b}`)});return d.useEffect(()=>{const C=l.get("authenticator"),y=l.get("error");if(C===u.name&&y){r.message.error(y);return}}),a.jsx(r.Space,{direction:"vertical",style:{display:"flex"},children:a.jsx(r.Button,{shape:"round",block:!0,icon:a.jsx(i.LoginOutlined,{}),onClick:v,children:u.title})})};class f extends t.Plugin{load(){return m(this,null,function*(){this.app.pm.get(o).registerType(g,{components:{SignInButton:P,AdminSettingsForm:q}})})}}e.SamlPlugin=f,e.default=f,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "1.3.
|
|
3
|
+
"@tachybase/client": "1.3.22",
|
|
4
4
|
"antd": "5.22.5",
|
|
5
|
-
"@tachybase/module-auth": "1.3.
|
|
6
|
-
"@
|
|
7
|
-
"@
|
|
5
|
+
"@tachybase/module-auth": "1.3.22",
|
|
6
|
+
"@ant-design/icons": "5.6.1",
|
|
7
|
+
"@tego/client": "1.3.39",
|
|
8
8
|
"react-router-dom": "6.28.1",
|
|
9
|
-
"@
|
|
10
|
-
"@tachybase/database": "1.3.20",
|
|
9
|
+
"@tego/server": "1.3.39",
|
|
11
10
|
"axios": "1.7.7",
|
|
12
|
-
"
|
|
13
|
-
"react-i18next": "15.2.0",
|
|
14
|
-
"@tachybase/actions": "1.3.20"
|
|
11
|
+
"react-i18next": "15.2.0"
|
|
15
12
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Context, Next } from '@
|
|
1
|
+
import { Context, Next } from '@tego/server';
|
|
2
2
|
export declare const login: (ctx: Context, next: Next) => Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Context, Next } from '@
|
|
1
|
+
import { Context, Next } from '@tego/server';
|
|
2
2
|
export declare const service: (ctx: Context, next: Next) => Promise<any>;
|
|
@@ -20,7 +20,7 @@ __export(service_exports, {
|
|
|
20
20
|
service: () => service
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(service_exports);
|
|
23
|
-
var import_server = require("@
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
24
|
const service = async (ctx, next) => {
|
|
25
25
|
const { authenticator, __appName: appName, redirect } = ctx.action.params;
|
|
26
26
|
let prefix = process.env.APP_PUBLIC_PATH || "";
|
package/dist/server/auth.d.ts
CHANGED
package/dist/server/auth.js
CHANGED
|
@@ -30,9 +30,9 @@ __export(auth_exports, {
|
|
|
30
30
|
CASAuth: () => CASAuth
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(auth_exports);
|
|
33
|
-
var
|
|
33
|
+
var import_server = require("@tego/server");
|
|
34
34
|
var import_axios = __toESM(require("axios"));
|
|
35
|
-
class CASAuth extends
|
|
35
|
+
class CASAuth extends import_server.BaseAuth {
|
|
36
36
|
constructor(config) {
|
|
37
37
|
const { ctx } = config;
|
|
38
38
|
super({
|
package/dist/server/plugin.d.ts
CHANGED
package/dist/server/plugin.js
CHANGED
|
@@ -21,7 +21,7 @@ __export(plugin_exports, {
|
|
|
21
21
|
default: () => plugin_default
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(plugin_exports);
|
|
24
|
-
var import_server = require("@
|
|
24
|
+
var import_server = require("@tego/server");
|
|
25
25
|
var import_constants = require("../constants");
|
|
26
26
|
var import_login = require("./actions/login");
|
|
27
27
|
var import_service = require("./actions/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.3.
|
|
4
|
+
"version": "1.3.22",
|
|
5
5
|
"description": "CAS authentication.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Authentication"
|
|
@@ -10,25 +10,18 @@
|
|
|
10
10
|
"main": "./dist/server/index.js",
|
|
11
11
|
"dependencies": {},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@ant-design/icons": "
|
|
13
|
+
"@ant-design/icons": "^5.6.1",
|
|
14
|
+
"@tachybase/test": "^1.3.39",
|
|
15
|
+
"@tego/client": "^1.3.39",
|
|
16
|
+
"@tego/server": "^1.3.39",
|
|
14
17
|
"antd": "5.22.5",
|
|
15
18
|
"axios": "1.7.7",
|
|
16
|
-
"react-i18next": "
|
|
17
|
-
"react-router-dom": "6.28.1"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"@tachybase/actions": "1.3.20",
|
|
21
|
-
"@tachybase/auth": "1.3.20",
|
|
22
|
-
"@tachybase/client": "1.3.20",
|
|
23
|
-
"@tachybase/database": "1.3.20",
|
|
24
|
-
"@tachybase/sdk": "1.3.20",
|
|
25
|
-
"@tachybase/test": "1.3.20",
|
|
26
|
-
"@tachybase/server": "1.3.20",
|
|
27
|
-
"@tachybase/module-auth": "1.3.20"
|
|
19
|
+
"react-i18next": "15.2.0",
|
|
20
|
+
"react-router-dom": "6.28.1",
|
|
21
|
+
"@tachybase/client": "1.3.22",
|
|
22
|
+
"@tachybase/module-auth": "1.3.22"
|
|
28
23
|
},
|
|
29
24
|
"description.zh-CN": "通过 CAS 协议认证身份。",
|
|
30
25
|
"displayName.zh-CN": "认证:CAS",
|
|
31
|
-
"scripts": {
|
|
32
|
-
"build": "tachybase-build --no-dts @tachybase/plugin-auth-cas"
|
|
33
|
-
}
|
|
26
|
+
"scripts": {}
|
|
34
27
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { useApp } from '@tachybase/client';
|
|
3
3
|
import { Authenticator } from '@tachybase/module-auth/client';
|
|
4
|
-
import { getSubAppName } from '@tachybase/sdk';
|
|
5
4
|
|
|
6
5
|
import { LoginOutlined } from '@ant-design/icons';
|
|
6
|
+
import { getSubAppName } from '@tego/client';
|
|
7
7
|
import { Button, message, Space } from 'antd';
|
|
8
8
|
import { useLocation } from 'react-router-dom';
|
|
9
9
|
|
package/src/server/auth.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { AuthConfig, BaseAuth } from '@tachybase/auth';
|
|
2
|
-
import { Model } from '@tachybase/database';
|
|
3
1
|
import { AuthModel } from '@tachybase/module-auth';
|
|
4
2
|
|
|
3
|
+
import { AuthConfig, BaseAuth, Model } from '@tego/server';
|
|
5
4
|
import axios from 'axios';
|
|
6
5
|
|
|
7
6
|
export class CASAuth extends BaseAuth {
|
package/src/server/plugin.ts
CHANGED