@tachybase/plugin-auth-cas 1.3.21 → 1.3.23

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.
@@ -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("@tachybase/sdk"),require("@ant-design/icons"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/module-auth/client","react/jsx-runtime","antd","react-i18next","react","@tachybase/sdk","@ant-design/icons","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["@tachybase/sdk"],e["@ant-design/icons"],e["react-router-dom"]))})(this,function(e,t,a,o,r,d,p,i,n,s){"use strict";var h=(e,t,a)=>new Promise((o,r)=>{var d=n=>{try{i(a.next(n))}catch(s){r(s)}},p=n=>{try{i(a.throw(n))}catch(s){r(s)}},i=n=>n.done?o(n.value):Promise.resolve(n.value).then(d,p);i((a=a.apply(e,t)).next())});const x="CAS",l="cas";function S(){return d.useTranslation(l)}function g(c){return`{{t('${c}', { ns: '${l}', nsMode: 'fallback' })}}`}const b=()=>{const{t:c}=S();return o.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:g("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}}}})},q=c=>{const u=c.authenticator,P=s.useLocation(),m=new URLSearchParams(P.search),T=m.get("redirect"),A=t.useApp(),j=i.getSubAppName(A.getPublicPath())||"main",k=()=>h(null,null,function*(){window.location.replace(`/api/cas:login?authenticator=${u.name}&__appName=${j}&redirect=${T}`)});return p.useEffect(()=>{const v=m.get("authenticator"),f=m.get("error");if(v===u.name&&f){r.message.error(f);return}}),o.jsx(r.Space,{direction:"vertical",style:{display:"flex"},children:o.jsx(r.Button,{shape:"round",block:!0,icon:o.jsx(n.LoginOutlined,{}),onClick:k,children:u.title})})};class y extends t.Plugin{load(){return h(this,null,function*(){this.app.pm.get(a).registerType(x,{components:{SignInButton:q,AdminSettingsForm:b}})})}}e.SamlPlugin=y,e.default=y,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
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"}})});
@@ -1,15 +1,12 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.3.21",
3
+ "@tachybase/client": "1.3.23",
4
4
  "antd": "5.22.5",
5
- "@tachybase/module-auth": "1.3.21",
6
- "@tachybase/sdk": "1.3.21",
7
- "@ant-design/icons": "5.3.7",
5
+ "@tachybase/module-auth": "1.3.23",
6
+ "@ant-design/icons": "5.6.1",
7
+ "@tego/client": "1.3.43",
8
8
  "react-router-dom": "6.28.1",
9
- "@tachybase/auth": "1.3.21",
10
- "@tachybase/database": "1.3.21",
9
+ "@tego/server": "1.3.43",
11
10
  "axios": "1.7.7",
12
- "@tachybase/server": "1.3.21",
13
- "react-i18next": "15.2.0",
14
- "@tachybase/actions": "1.3.21"
11
+ "react-i18next": "15.2.0"
15
12
  };
@@ -1,2 +1,2 @@
1
- import { Context, Next } from '@tachybase/actions';
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 '@tachybase/actions';
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("@tachybase/server");
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 || "";
@@ -1,5 +1,4 @@
1
- import { AuthConfig, BaseAuth } from '@tachybase/auth';
2
- import { Model } from '@tachybase/database';
1
+ import { AuthConfig, BaseAuth, Model } from '@tego/server';
3
2
  export declare class CASAuth extends BaseAuth {
4
3
  constructor(config: AuthConfig);
5
4
  getOptions(): {
@@ -30,9 +30,9 @@ __export(auth_exports, {
30
30
  CASAuth: () => CASAuth
31
31
  });
32
32
  module.exports = __toCommonJS(auth_exports);
33
- var import_auth = require("@tachybase/auth");
33
+ var import_server = require("@tego/server");
34
34
  var import_axios = __toESM(require("axios"));
35
- class CASAuth extends import_auth.BaseAuth {
35
+ class CASAuth extends import_server.BaseAuth {
36
36
  constructor(config) {
37
37
  const { ctx } = config;
38
38
  super({
@@ -1,4 +1,4 @@
1
- import { InstallOptions, Plugin } from '@tachybase/server';
1
+ import { InstallOptions, Plugin } from '@tego/server';
2
2
  export declare class CasPlugin extends Plugin {
3
3
  afterAdd(): void;
4
4
  beforeLoad(): void;
@@ -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("@tachybase/server");
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.21",
4
+ "version": "1.3.23",
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": "~5.3.7",
13
+ "@ant-design/icons": "^5.6.1",
14
+ "@tachybase/test": "^1.3.43",
15
+ "@tego/client": "^1.3.43",
16
+ "@tego/server": "^1.3.43",
14
17
  "antd": "5.22.5",
15
18
  "axios": "1.7.7",
16
- "react-i18next": "^15.2.0",
17
- "react-router-dom": "6.28.1"
18
- },
19
- "peerDependencies": {
20
- "@tachybase/actions": "1.3.21",
21
- "@tachybase/auth": "1.3.21",
22
- "@tachybase/client": "1.3.21",
23
- "@tachybase/database": "1.3.21",
24
- "@tachybase/sdk": "1.3.21",
25
- "@tachybase/module-auth": "1.3.21",
26
- "@tachybase/server": "1.3.21",
27
- "@tachybase/test": "1.3.21"
19
+ "react-i18next": "15.2.0",
20
+ "react-router-dom": "6.28.1",
21
+ "@tachybase/client": "1.3.23",
22
+ "@tachybase/module-auth": "1.3.23"
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
 
@@ -1,4 +1,4 @@
1
- import { Context, Next } from '@tachybase/actions';
1
+ import { Context, Next } from '@tego/server';
2
2
 
3
3
  import { CASAuth } from '../auth';
4
4
 
@@ -1,5 +1,4 @@
1
- import { Context, Next } from '@tachybase/actions';
2
- import { AppSupervisor } from '@tachybase/server';
1
+ import { AppSupervisor, Context, Next } from '@tego/server';
3
2
 
4
3
  import { CASAuth } from '../auth';
5
4
 
@@ -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 {
@@ -1,4 +1,4 @@
1
- import { InstallOptions, Plugin } from '@tachybase/server';
1
+ import { InstallOptions, Plugin } from '@tego/server';
2
2
 
3
3
  import { authType } from '../constants';
4
4
  import { login } from './actions/login';