@authing/react-ui-components 2.4.55-alpha.5 → 2.4.57

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.
Files changed (35) hide show
  1. package/lib/index.d.ts +9 -7
  2. package/lib/index.min.css +1 -1
  3. package/lib/index.min.js +1 -1
  4. package/package.json +2 -2
  5. package/src/components/AuthingGuard/Forms/QrCodeLoginForm/index.tsx +1 -3
  6. package/src/components/AuthingGuard/Forms/SocialAndIdpLogin/index.tsx +3 -3
  7. package/src/components/AuthingGuard/GuardLayout/index.tsx +5 -5
  8. package/src/components/AuthingGuard/LoginLayout/index.tsx +22 -53
  9. package/src/components/AuthingGuard/api/appConfig.ts +17 -2
  10. package/src/components/AuthingGuard/api/userPoolConfig.ts +0 -2
  11. package/src/components/AuthingGuard/style.less +1 -0
  12. package/src/components/AuthingGuard/types/Forms.ts +0 -1
  13. package/src/components/AuthingGuard/types/GuardConfig.ts +2 -1
  14. package/src/index.tsx +3 -3
  15. package/build/asset-manifest.json +0 -25
  16. package/build/favicon.ico +0 -0
  17. package/build/index.html +0 -1
  18. package/build/logo192.png +0 -0
  19. package/build/logo512.png +0 -0
  20. package/build/manifest.json +0 -25
  21. package/build/robots.txt +0 -3
  22. package/build/static/css/2.e5f4a1ca.chunk.css +0 -2
  23. package/build/static/css/2.e5f4a1ca.chunk.css.map +0 -1
  24. package/build/static/css/main.4dd73333.chunk.css +0 -2
  25. package/build/static/css/main.4dd73333.chunk.css.map +0 -1
  26. package/build/static/js/2.b28e1968.chunk.js +0 -3
  27. package/build/static/js/2.b28e1968.chunk.js.LICENSE.txt +0 -70
  28. package/build/static/js/2.b28e1968.chunk.js.map +0 -1
  29. package/build/static/js/3.584da164.chunk.js +0 -2
  30. package/build/static/js/3.584da164.chunk.js.map +0 -1
  31. package/build/static/js/main.eeb41586.chunk.js +0 -2
  32. package/build/static/js/main.eeb41586.chunk.js.map +0 -1
  33. package/build/static/js/runtime-main.6174f3e9.js +0 -2
  34. package/build/static/js/runtime-main.6174f3e9.js.map +0 -1
  35. package/yarn-error.log +0 -19616
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@authing/react-ui-components",
3
- "version": "2.4.55-alpha.5",
3
+ "version": "2.4.57",
4
4
  "private": false,
5
5
  "main": "lib/index.min.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "dependencies": {
8
8
  "antd": "^4.8.0",
9
- "authing-js-sdk": "4.22.26-alpha.9",
9
+ "authing-js-sdk": "4.22.24-alpha",
10
10
  "qs": "^6.9.4"
11
11
  },
12
12
  "peerDependencies": {
@@ -14,7 +14,6 @@ export const QrCodeLoginForm: FC<QrLoginFormProps> = ({
14
14
  onFail,
15
15
  onSuccess,
16
16
  type,
17
- idpId,
18
17
  }) => {
19
18
  const {
20
19
  state: { authClient, config },
@@ -32,7 +31,6 @@ export const QrCodeLoginForm: FC<QrLoginFormProps> = ({
32
31
 
33
32
  useEffect(() => {
34
33
  client.startScanning('authingGuardQrcode', {
35
- extIdpConnId: idpId,
36
34
  autoExchangeUserInfo: true,
37
35
  ...config.qrCodeScanOptions,
38
36
  onStart(timer) {
@@ -48,7 +46,7 @@ export const QrCodeLoginForm: FC<QrLoginFormProps> = ({
48
46
  },
49
47
  })
50
48
  return () => clearInterval(timerRef.current)
51
- }, [client, config.qrCodeScanOptions, idpId, onFail, onSuccess])
49
+ }, [client, config.qrCodeScanOptions, onFail, onSuccess])
52
50
 
53
51
  return (
54
52
  <div className="authing-guard-qr-form">
@@ -218,7 +218,7 @@ export const SocialAndIdpLogin: FC<SocialAndIdpLoginProps> = ({
218
218
  }
219
219
 
220
220
  const onLogin = () => {
221
- authClient.social.authorize(item.identifier, {
221
+ authClient.social.authorize(item.provider, {
222
222
  onSuccess(user) {
223
223
  onSuccess(user)
224
224
  },
@@ -254,12 +254,12 @@ export const SocialAndIdpLogin: FC<SocialAndIdpLoginProps> = ({
254
254
  }
255
255
  onClick={onLogin}
256
256
  >
257
- {item.tooltip?.[i18n.language as Lang] || item.displayName}
257
+ {item.tooltip?.[i18n.language as Lang] || item.name}
258
258
  </Button>
259
259
  ) : (
260
260
  <Tooltip
261
261
  key={item.provider}
262
- title={item.tooltip?.[i18n.language as Lang] || item.displayName}
262
+ title={item.tooltip?.[i18n.language as Lang] || item.name}
263
263
  >
264
264
  <div className="authing-social-login-item" onClick={onLogin}>
265
265
  <IconFont type={iconType} />
@@ -156,6 +156,9 @@ const useGuardConfig = () => {
156
156
  appConfig.loginTabs?.list ||
157
157
  defaultGuardConfig.loginMethods
158
158
 
159
+ // 扫码多源配置
160
+ const qrcodeTabsSettings = appConfig.qrcodeTabsSettings
161
+
159
162
  // 账密登录的登录拆分
160
163
  const passwordLoginMethods =
161
164
  userConfig.passwordLoginMethods ||
@@ -165,12 +168,9 @@ const useGuardConfig = () => {
165
168
  // 默认登录方式
166
169
  const defaultLoginMethod =
167
170
  userConfig.defaultLoginMethod ||
168
- appConfig.loginTabs?.defaultV2 ||
169
171
  appConfig.loginTabs?.default ||
170
172
  defaultGuardConfig.defaultLoginMethod
171
173
 
172
- const loginMethodTitleMapping = appConfig.loginTabs?.title
173
-
174
174
  // 注册方式
175
175
  const registerMethods =
176
176
  userConfig.registerMethods ||
@@ -236,16 +236,16 @@ const useGuardConfig = () => {
236
236
  defaultRegisterMethod,
237
237
  enterpriseConnectionObjs,
238
238
  publicKey: appConfig.publicKey,
239
+ qrcodeTabsSettings,
239
240
  agreementEnabled: appConfig.agreementEnabled,
240
241
  agreements: appConfig.agreements,
241
- loginMethodTitleMapping: loginMethodTitleMapping,
242
242
  }
243
243
  )
244
244
  }, [
245
245
  userConfig,
246
246
  appConfig.loginTabs?.list,
247
247
  appConfig.loginTabs?.default,
248
- appConfig.loginTabs?.title,
248
+ appConfig.qrcodeTabsSettings,
249
249
  appConfig.passwordTabConfig?.enabledLoginMethods,
250
250
  appConfig.registerTabs?.list,
251
251
  appConfig.registerTabs?.default,
@@ -75,36 +75,36 @@ const useNormalLoginTabs = ({ onSuccess, onFail }: BaseFormProps) => {
75
75
  }
76
76
 
77
77
  const LOGIN_FORM_MAP = {
78
- [LoginMethods.Password]: (props: any) => (
78
+ [LoginMethods.Password]: (
79
79
  <PasswordLoginForm
80
- {...props}
80
+ {...formProps}
81
81
  ref={(v) => (formRef.current[LoginMethods.Password] = v!)}
82
82
  />
83
83
  ),
84
- [LoginMethods.PhoneCode]: (props: any) => (
84
+ [LoginMethods.PhoneCode]: (
85
85
  <PhoneCodeLoginForm
86
- {...props}
86
+ {...formProps}
87
87
  ref={(v) => (formRef.current[LoginMethods.PhoneCode] = v!)}
88
88
  />
89
89
  ),
90
- [LoginMethods.AppQr]: (props: any) => (
91
- <QrCodeLoginForm type={LoginMethods.AppQr} {...props} />
90
+ [LoginMethods.AppQr]: (
91
+ <QrCodeLoginForm type={LoginMethods.AppQr} {...formProps} />
92
92
  ),
93
- [LoginMethods.WxMinQr]: (props: any) => (
94
- <QrCodeLoginForm type={LoginMethods.WxMinQr} {...props} />
93
+ [LoginMethods.WxMinQr]: (
94
+ <QrCodeLoginForm type={LoginMethods.WxMinQr} {...formProps} />
95
95
  ),
96
- [LoginMethods.LDAP]: (props: any) => (
96
+ [LoginMethods.LDAP]: (
97
97
  <LdapLoginForm
98
- {...props}
98
+ {...formProps}
99
99
  ref={(v) => (formRef.current[LoginMethods.LDAP] = v!)}
100
100
  />
101
101
  ),
102
- [LoginMethods.WechatMpQrcode]: (props: any) => (
103
- <QrCodeLoginForm type={LoginMethods.WechatMpQrcode} {...props} />
102
+ [LoginMethods.WechatMpQrcode]: (
103
+ <QrCodeLoginForm type={LoginMethods.WechatMpQrcode} {...formProps} />
104
104
  ),
105
- [LoginMethods.AD]: (props: any) => (
105
+ [LoginMethods.AD]: (
106
106
  <ADLoginForm
107
- {...props}
107
+ {...formProps}
108
108
  ref={(v) => (formRef.current[LoginMethods.AD] = v!)}
109
109
  />
110
110
  ),
@@ -113,38 +113,13 @@ const useNormalLoginTabs = ({ onSuccess, onFail }: BaseFormProps) => {
113
113
  const {
114
114
  state: { config },
115
115
  } = useGuardContext()
116
- const { loginMethods = [], loginMethodTitleMapping } = config
117
-
118
- const tabs = loginMethods
119
- .map((tab) => {
120
- if (
121
- !loginMethods.every(
122
- (item) => !(item.split(':').length > 1 && item.split(':')[0] === tab)
123
- )
124
- )
125
- return undefined
126
-
127
- const idpId = tab.split(':').length > 1 ? tab.split(':')[1] : undefined
128
-
129
- if (idpId) {
130
- const type = tab.split(':')[0] as LoginMethods
131
- return {
132
- key: tab,
133
- label: loginMethodTitleMapping[tab]!,
134
- component: LOGIN_FORM_MAP[type]({
135
- ...formProps,
136
- idpId: idpId,
137
- }),
138
- }
139
- } else {
140
- return {
141
- key: tab,
142
- label: LOGIN_METHODS_MAP()?.[tab]!,
143
- component: LOGIN_FORM_MAP[tab](formProps),
144
- }
145
- }
146
- })
147
- .filter((i) => i !== undefined)
116
+ const { loginMethods = [] } = config
117
+
118
+ const tabs = loginMethods.map((item) => ({
119
+ key: item,
120
+ label: LOGIN_METHODS_MAP()?.[item]!,
121
+ component: LOGIN_FORM_MAP[item],
122
+ }))
148
123
 
149
124
  return {
150
125
  tabs,
@@ -168,13 +143,7 @@ export const LoginLayout = () => {
168
143
  return (
169
144
  <>
170
145
  <AuthingTabs
171
- tabs={
172
- tabs as {
173
- key: LoginMethods
174
- label: string
175
- component: JSX.Element
176
- }[]
177
- }
146
+ tabs={tabs}
178
147
  onTabClick={(t) =>
179
148
  setValue('activeTabs', {
180
149
  ...activeTabs,
@@ -1,5 +1,9 @@
1
1
  import { requestClient } from './http'
2
- import { Lang, Protocol } from '../../../components/AuthingGuard/types'
2
+ import {
3
+ Lang,
4
+ LoginMethods,
5
+ Protocol,
6
+ } from '../../../components/AuthingGuard/types'
3
7
  import {
4
8
  IAzureAdConnectionConfig,
5
9
  ICasConnectionConfig,
@@ -25,6 +29,15 @@ export const ApplicationMfaTypeLabel: () => Record<
25
29
  [ApplicationMfaType.EMAIL]: i18n.t('common.EmailVerification'),
26
30
  })
27
31
 
32
+ export type QrcodeTabsSettings = Record<
33
+ LoginMethods,
34
+ {
35
+ id: string
36
+ title: string
37
+ isDefault?: boolean
38
+ }
39
+ >
40
+
28
41
  export interface OidcClientMetadata {
29
42
  grant_types: string[]
30
43
  client_id: string
@@ -83,10 +96,12 @@ export interface ApplicationConfig {
83
96
  default: string
84
97
  title: { [x: string]: string }
85
98
  }
99
+
100
+ qrcodeTabsSettings: QrcodeTabsSettings
101
+
86
102
  loginTabs: {
87
103
  list: string[]
88
104
  default: string
89
- defaultV2?: string
90
105
  title: { [x: string]: string }
91
106
  }
92
107
  socialConnections: SocialConnectionItem[]
@@ -72,10 +72,8 @@ export interface ICasConnectionConfig {
72
72
  }
73
73
  export interface SocialConnectionItem {
74
74
  name: string
75
- displayName: string
76
75
  logo: string
77
76
  description: string
78
- identifier: string
79
77
  provider: SocialConnectionProvider
80
78
  authorizationUrl: string
81
79
  tooltip: Record<Lang, string>
@@ -70,6 +70,7 @@
70
70
  }
71
71
  }
72
72
  }
73
+
73
74
  .authing-data-tips__top {
74
75
  position: relative;
75
76
  &::after {
@@ -27,7 +27,6 @@ export interface LdapLoginFormProps extends BaseFormProps {
27
27
 
28
28
  export interface QrLoginFormProps extends BaseFormProps {
29
29
  type: LoginMethods.AppQr | LoginMethods.WxMinQr | LoginMethods.WechatMpQrcode
30
- idpId?: string
31
30
  }
32
31
 
33
32
  export interface EmailRegisterFormProps extends BaseFormProps {
@@ -13,6 +13,7 @@ import {
13
13
  ApplicationConfig,
14
14
  PasswordLoginMethods,
15
15
  Agreement,
16
+ QrcodeTabsSettings,
16
17
  } from '../../../components/AuthingGuard/api'
17
18
  import { Lang } from './Locales'
18
19
 
@@ -412,7 +413,7 @@ export interface GuardConfig extends UserConfig {
412
413
  publicKey: ApplicationConfig['publicKey']
413
414
  agreementEnabled: boolean
414
415
  agreements: Agreement[]
415
- loginMethodTitleMapping: Record<string, string>
416
+ qrcodeTabsSettings: QrcodeTabsSettings
416
417
  }
417
418
 
418
419
  export interface LocalesConfig {
package/src/index.tsx CHANGED
@@ -21,7 +21,7 @@ const App = () => {
21
21
 
22
22
  const config: UserConfig = {
23
23
  mode: GuardMode.Modal,
24
- appHost: 'https://core.dev2.authing-inc.co',
24
+ appHost: 'https://core.dev2.authing-inc.co/',
25
25
  // apiHost: 'http://console.authing.localhost:3000',
26
26
  // apiHost: 'http://192.168.50.57:3000',
27
27
  // loginMethods: Object.values(LoginMethods),
@@ -114,8 +114,8 @@ const App = () => {
114
114
  }}
115
115
  // onLoad={(a) => console.log(a, '加载完成')}
116
116
  // onPwdResetError={(e) => console.log(e)}
117
- appId="619c7976cd38c13a2222464f"
118
- tenantId="619c864928b15c6421d12e35"
117
+ appId="6191cf610f772aa56dc70637"
118
+ tenantId="6194a41abf23c1d5268b362a"
119
119
  // appId="5fd877fb0ba0421962eced94"
120
120
  config={config}
121
121
  />
@@ -1,25 +0,0 @@
1
- {
2
- "files": {
3
- "main.css": "/static/css/main.4dd73333.chunk.css",
4
- "main.js": "/static/js/main.eeb41586.chunk.js",
5
- "main.js.map": "/static/js/main.eeb41586.chunk.js.map",
6
- "runtime-main.js": "/static/js/runtime-main.6174f3e9.js",
7
- "runtime-main.js.map": "/static/js/runtime-main.6174f3e9.js.map",
8
- "static/css/2.e5f4a1ca.chunk.css": "/static/css/2.e5f4a1ca.chunk.css",
9
- "static/js/2.b28e1968.chunk.js": "/static/js/2.b28e1968.chunk.js",
10
- "static/js/2.b28e1968.chunk.js.map": "/static/js/2.b28e1968.chunk.js.map",
11
- "static/js/3.584da164.chunk.js": "/static/js/3.584da164.chunk.js",
12
- "static/js/3.584da164.chunk.js.map": "/static/js/3.584da164.chunk.js.map",
13
- "index.html": "/index.html",
14
- "static/css/2.e5f4a1ca.chunk.css.map": "/static/css/2.e5f4a1ca.chunk.css.map",
15
- "static/css/main.4dd73333.chunk.css.map": "/static/css/main.4dd73333.chunk.css.map",
16
- "static/js/2.b28e1968.chunk.js.LICENSE.txt": "/static/js/2.b28e1968.chunk.js.LICENSE.txt"
17
- },
18
- "entrypoints": [
19
- "static/js/runtime-main.6174f3e9.js",
20
- "static/css/2.e5f4a1ca.chunk.css",
21
- "static/js/2.b28e1968.chunk.js",
22
- "static/css/main.4dd73333.chunk.css",
23
- "static/js/main.eeb41586.chunk.js"
24
- ]
25
- }
package/build/favicon.ico DELETED
Binary file
package/build/index.html DELETED
@@ -1 +0,0 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><link href="/static/css/2.e5f4a1ca.chunk.css" rel="stylesheet"><link href="/static/css/main.4dd73333.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,a,i=t[0],c=t[1],l=t[2],s=0,p=[];s<i.length;s++)a=i[s],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&p.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(t);p.length;)p.shift()();return u.push.apply(u,l||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,i=1;i<r.length;i++){var c=r[i];0!==o[c]&&(n=!1)}n&&(u.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={1:0},u=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+"static/js/"+({}[e]||e)+"."+{3:"584da164"}[e]+".chunk.js"}(e);var c=new Error;u=function(t){i.onerror=i.onload=null,clearTimeout(l);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),u=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,r[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/",a.oe=function(e){throw console.error(e),e};var i=this["webpackJsonp@authing/react-ui-components"]=this["webpackJsonp@authing/react-ui-components"]||[],c=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var f=c;r()}([])</script><script src="/static/js/2.b28e1968.chunk.js"></script><script src="/static/js/main.eeb41586.chunk.js"></script></body></html>
package/build/logo192.png DELETED
Binary file
package/build/logo512.png DELETED
Binary file
@@ -1,25 +0,0 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
25
- }
package/build/robots.txt DELETED
@@ -1,3 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow: