@authing/react-ui-components 3.0.2-beta.5 → 3.1.1-rc.1

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 (249) hide show
  1. package/.vscode/settings.json +1 -1
  2. package/LICENSE +21 -0
  3. package/config/env.js +26 -24
  4. package/config/paths.js +3 -3
  5. package/config/webpack.config.js +29 -7
  6. package/lib/index.d.ts +211 -1252
  7. package/lib/index.min.css +1 -2
  8. package/lib/index.min.js +1 -1
  9. package/lib/index.min.js.LICENSE.txt +0 -32
  10. package/package.json +14 -20
  11. package/scripts/build.js +83 -79
  12. package/scripts/start.js +73 -69
  13. package/scripts/test.js +23 -19
  14. package/{components → src/common}/AuthingDropdown/index.tsx +1 -1
  15. package/{components → src/common}/AuthingDropdown/style.less +0 -0
  16. package/{components → src/common}/AuthingTabs/index.tsx +1 -1
  17. package/{components → src/common}/AuthingTabs/style.less +0 -0
  18. package/{components → src/common}/CopyAbleText/index.tsx +1 -1
  19. package/{components → src/common}/CopyAbleText/style.less +0 -0
  20. package/{components → src/common}/VerifyCodeInput/index.tsx +0 -0
  21. package/{components → src/common}/VerifyCodeInput/style.less +0 -0
  22. package/{components → src/components}/AuthingGuard/AppMFALayout/index.tsx +2 -2
  23. package/{components → src/components}/AuthingGuard/AppMFALayout/style.less +0 -0
  24. package/{components → src/components}/AuthingGuard/CompleteUserInfoLayout/index.tsx +1 -1
  25. package/{components → src/components}/AuthingGuard/CompleteUserInfoLayout/style.less +0 -0
  26. package/{components → src/components}/AuthingGuard/Forms/ADLoginForm/index.tsx +2 -2
  27. package/{components → src/components}/AuthingGuard/Forms/Agreements/index.tsx +1 -1
  28. package/{components → src/components}/AuthingGuard/Forms/Agreements/style.less +0 -0
  29. package/{components → src/components}/AuthingGuard/Forms/CompleteUserInfoForm/index.tsx +3 -3
  30. package/{components → src/components}/AuthingGuard/Forms/EmailMfaVerifyForm/CheckEmailForm.tsx +4 -2
  31. package/{components → src/components}/AuthingGuard/Forms/EmailMfaVerifyForm/VerifyCodeForm.tsx +2 -2
  32. package/{components → src/components}/AuthingGuard/Forms/EmailMfaVerifyForm/index.tsx +1 -1
  33. package/{components → src/components}/AuthingGuard/Forms/EmailMfaVerifyForm/style.less +0 -0
  34. package/{components → src/components}/AuthingGuard/Forms/EmailRegisterForm/index.tsx +2 -2
  35. package/{components → src/components}/AuthingGuard/Forms/EmailRegisterForm/style.less +0 -0
  36. package/{components → src/components}/AuthingGuard/Forms/LdapLoginForm/index.tsx +4 -9
  37. package/{components → src/components}/AuthingGuard/Forms/LdapLoginForm/style.less +0 -0
  38. package/{components → src/components}/AuthingGuard/Forms/LoginFormFooter/index.tsx +1 -1
  39. package/{components → src/components}/AuthingGuard/Forms/LoginFormFooter/style.less +0 -0
  40. package/{components → src/components}/AuthingGuard/Forms/MfaResetCodeForm/Step1.tsx +2 -2
  41. package/{components → src/components}/AuthingGuard/Forms/MfaResetCodeForm/Step2.tsx +1 -1
  42. package/{components → src/components}/AuthingGuard/Forms/MfaResetCodeForm/index.tsx +1 -1
  43. package/{components → src/components}/AuthingGuard/Forms/MfaResetCodeForm/style.less +0 -0
  44. package/{components → src/components}/AuthingGuard/Forms/MfaVerifyForm/index.tsx +2 -2
  45. package/{components → src/components}/AuthingGuard/Forms/MfaVerifyForm/style.less +0 -0
  46. package/{components → src/components}/AuthingGuard/Forms/PasswordLoginForm/index.tsx +3 -3
  47. package/{components → src/components}/AuthingGuard/Forms/PhoneCodeLoginForm/index.tsx +2 -2
  48. package/{components → src/components}/AuthingGuard/Forms/PhoneRegisterForm/index.tsx +2 -2
  49. package/{components → src/components}/AuthingGuard/Forms/QrCodeLoginForm/index.tsx +4 -2
  50. package/{components → src/components}/AuthingGuard/Forms/QrCodeLoginForm/style.less +0 -0
  51. package/{components → src/components}/AuthingGuard/Forms/RegisterFormFooter/index.tsx +1 -1
  52. package/{components → src/components}/AuthingGuard/Forms/RegisterFormFooter/style.less +0 -0
  53. package/{components → src/components}/AuthingGuard/Forms/ResetPwdForm/Footer.tsx +1 -1
  54. package/{components → src/components}/AuthingGuard/Forms/ResetPwdForm/Step1.tsx +2 -2
  55. package/{components → src/components}/AuthingGuard/Forms/ResetPwdForm/Step2.tsx +2 -2
  56. package/{components → src/components}/AuthingGuard/Forms/ResetPwdForm/Step3.tsx +2 -2
  57. package/{components → src/components}/AuthingGuard/Forms/ResetPwdForm/Step4.tsx +1 -1
  58. package/{components → src/components}/AuthingGuard/Forms/ResetPwdForm/index.tsx +1 -1
  59. package/{components → src/components}/AuthingGuard/Forms/ResetPwdForm/style.less +0 -0
  60. package/{components → src/components}/AuthingGuard/Forms/SendPhoneCode/SendCodeBtn.tsx +0 -0
  61. package/{components → src/components}/AuthingGuard/Forms/SendPhoneCode/index.tsx +2 -2
  62. package/{components → src/components}/AuthingGuard/Forms/SendPhoneCode/style.less +0 -0
  63. package/{components → src/components}/AuthingGuard/Forms/SmsMfaVerifyForm/CheckPhoneForm.tsx +2 -2
  64. package/{components → src/components}/AuthingGuard/Forms/SmsMfaVerifyForm/VerifyCodeForm.tsx +2 -2
  65. package/{components → src/components}/AuthingGuard/Forms/SmsMfaVerifyForm/index.tsx +1 -1
  66. package/{components → src/components}/AuthingGuard/Forms/SmsMfaVerifyForm/style.less +0 -0
  67. package/{components → src/components}/AuthingGuard/Forms/SocialAndIdpLogin/index.tsx +7 -7
  68. package/{components → src/components}/AuthingGuard/Forms/SocialAndIdpLogin/style.less +0 -0
  69. package/{components → src/components}/AuthingGuard/Forms/UploadImage/index.tsx +1 -1
  70. package/{components → src/components}/AuthingGuard/Forms/index.ts +0 -0
  71. package/{components → src/components}/AuthingGuard/GuardLayout/index.tsx +17 -3
  72. package/{components → src/components}/AuthingGuard/GuardLayout/style.less +0 -0
  73. package/{components → src/components}/AuthingGuard/Header/index.tsx +6 -3
  74. package/{components → src/components}/AuthingGuard/Header/style.less +23 -11
  75. package/{components → src/components}/AuthingGuard/IconFont/iconfont.js +0 -0
  76. package/{components → src/components}/AuthingGuard/IconFont/index.tsx +1 -1
  77. package/{components → src/components}/AuthingGuard/IconFont/style.less +0 -0
  78. package/{components → src/components}/AuthingGuard/IconFont/svg.js +0 -0
  79. package/{components → src/components}/AuthingGuard/LoginLayout/index.tsx +69 -25
  80. package/{components → src/components}/AuthingGuard/LoginLayout/style.less +0 -0
  81. package/{components → src/components}/AuthingGuard/MfaLayout/Steps.ts +0 -0
  82. package/{components → src/components}/AuthingGuard/MfaLayout/index.tsx +1 -1
  83. package/{components → src/components}/AuthingGuard/MfaLayout/style.less +0 -0
  84. package/{components → src/components}/AuthingGuard/RegisterLayout/index.tsx +2 -2
  85. package/{components → src/components}/AuthingGuard/RegisterLayout/style.less +0 -0
  86. package/{components → src/components}/AuthingGuard/ResetPwdLayout/index.tsx +1 -1
  87. package/{components → src/components}/AuthingGuard/ToggleLang/index.tsx +2 -2
  88. package/{components → src/components}/AuthingGuard/api/appConfig.ts +22 -14
  89. package/{components/_utils → src/components/AuthingGuard/api}/http.ts +33 -30
  90. package/{components → src/components}/AuthingGuard/api/index.ts +0 -0
  91. package/{components → src/components}/AuthingGuard/api/sso.ts +1 -1
  92. package/{components → src/components}/AuthingGuard/api/userPoolConfig.ts +3 -2
  93. package/{components → src/components}/AuthingGuard/constants.ts +2 -2
  94. package/{components → src/components}/AuthingGuard/hooks/index.tsx +0 -0
  95. package/{components → src/components}/AuthingGuard/hooks/useScreenSize.tsx +0 -0
  96. package/{components → src/components}/AuthingGuard/index.tsx +11 -3
  97. package/{components/_utils → src/components/AuthingGuard}/locales/en/common.json +26 -70
  98. package/{components/_utils → src/components/AuthingGuard}/locales/en/index.ts +0 -0
  99. package/{components/_utils → src/components/AuthingGuard}/locales/en/login.json +19 -21
  100. package/{components/_utils → src/components/AuthingGuard}/locales/en/map.json +0 -0
  101. package/{components/_utils → src/components/AuthingGuard}/locales/en/user.json +3 -4
  102. package/{components/_utils → src/components/AuthingGuard}/locales/index.ts +2 -2
  103. package/{components/_utils → src/components/AuthingGuard}/locales/zh/common.json +9 -53
  104. package/{components/_utils → src/components/AuthingGuard}/locales/zh/index.ts +0 -0
  105. package/{components/_utils → src/components/AuthingGuard}/locales/zh/login.json +4 -6
  106. package/{components/_utils → src/components/AuthingGuard}/locales/zh/map.json +0 -0
  107. package/{components/_utils → src/components/AuthingGuard}/locales/zh/user.json +1 -3
  108. package/{components → src/components}/AuthingGuard/style.less +5 -0
  109. package/{components → src/components}/AuthingGuard/types/Forms.ts +2 -1
  110. package/{components → src/components}/AuthingGuard/types/GuardConfig.ts +5 -1
  111. package/{components → src/components}/AuthingGuard/types/GuardState.ts +1 -1
  112. package/{components → src/components}/AuthingGuard/types/Locales.ts +0 -0
  113. package/{components → src/components}/AuthingGuard/types/index.ts +0 -0
  114. package/src/components/index.ts +7 -0
  115. package/{components → src}/context/base.tsx +0 -0
  116. package/{components → src}/context/global/context.tsx +0 -0
  117. package/{components → src}/context/global/reducer.tsx +2 -2
  118. package/src/index.tsx +142 -0
  119. package/{logo.svg → src/logo.svg} +0 -0
  120. package/{react-app-env.d.ts → src/react-app-env.d.ts} +0 -0
  121. package/{reportWebVitals.ts → src/reportWebVitals.ts} +0 -0
  122. package/{setupTests.ts → src/setupTests.ts} +0 -0
  123. package/{components/_utils → src/utils}/clipboard.ts +1 -1
  124. package/{components/_utils → src/utils}/index.ts +3 -149
  125. package/{components/_utils → src/utils}/popupCenter.ts +0 -0
  126. package/tsconfig.json +2 -8
  127. package/build/asset-manifest.json +0 -26
  128. package/build/favicon.ico +0 -0
  129. package/build/index.html +0 -1
  130. package/build/logo192.png +0 -0
  131. package/build/logo512.png +0 -0
  132. package/build/manifest.json +0 -25
  133. package/build/robots.txt +0 -3
  134. package/build/static/css/2.51c07e65.chunk.css +0 -3
  135. package/build/static/css/2.51c07e65.chunk.css.map +0 -1
  136. package/build/static/css/main.779f221a.chunk.css +0 -2
  137. package/build/static/css/main.779f221a.chunk.css.map +0 -1
  138. package/build/static/js/2.bbae9fdb.chunk.js +0 -3
  139. package/build/static/js/2.bbae9fdb.chunk.js.LICENSE.txt +0 -102
  140. package/build/static/js/2.bbae9fdb.chunk.js.map +0 -1
  141. package/build/static/js/3.fd17f196.chunk.js +0 -2
  142. package/build/static/js/3.fd17f196.chunk.js.map +0 -1
  143. package/build/static/js/main.5f341531.chunk.js +0 -2
  144. package/build/static/js/main.5f341531.chunk.js.map +0 -1
  145. package/build/static/js/runtime-main.ef138021.js +0 -2
  146. package/build/static/js/runtime-main.ef138021.js.map +0 -1
  147. package/build/static/media/loading.4a67a5f3.svg +0 -29
  148. package/components/BindTotp/core/bindSuccess.tsx +0 -72
  149. package/components/BindTotp/core/securityCode.tsx +0 -108
  150. package/components/BindTotp/index.tsx +0 -134
  151. package/components/BindTotp/interface.ts +0 -30
  152. package/components/BindTotp/styles.less +0 -57
  153. package/components/ChangeLanguage/index.tsx +0 -35
  154. package/components/ChangePassword/core/firstLoginReset.tsx +0 -111
  155. package/components/ChangePassword/core/rotateReset.tsx +0 -114
  156. package/components/ChangePassword/index.tsx +0 -72
  157. package/components/CompleteInfo/core/completeInfo.tsx +0 -155
  158. package/components/CompleteInfo/index.tsx +0 -45
  159. package/components/CompleteInfo/interface.ts +0 -40
  160. package/components/CompleteInfo/styles.less +0 -7
  161. package/components/DownloadAuthenticator/index.tsx +0 -97
  162. package/components/DownloadAuthenticator/interface.ts +0 -22
  163. package/components/DownloadAuthenticator/styles.less +0 -52
  164. package/components/Error/index.tsx +0 -21
  165. package/components/Error/interface.ts +0 -9
  166. package/components/Error/styles.less +0 -12
  167. package/components/ForgetPassword/core/resetPassword.tsx +0 -162
  168. package/components/ForgetPassword/index.tsx +0 -78
  169. package/components/ForgetPassword/interface.ts +0 -32
  170. package/components/Guard/Guard.tsx +0 -295
  171. package/components/Guard/authClient.ts +0 -44
  172. package/components/Guard/config.ts +0 -19
  173. package/components/Guard/event.ts +0 -52
  174. package/components/Guard/index.tsx +0 -4
  175. package/components/Guard/module.ts +0 -20
  176. package/components/Guard/stateMachine.ts +0 -152
  177. package/components/Guard/styles.less +0 -461
  178. package/components/IconFont/iconfont.js +0 -74
  179. package/components/IconFont/index.tsx +0 -16
  180. package/components/IconFont/style.less +0 -6
  181. package/components/IconFont/svg.js +0 -2
  182. package/components/ImagePro/index.tsx +0 -53
  183. package/components/ImagePro/styles.less +0 -40
  184. package/components/InputNumber/index.tsx +0 -33
  185. package/components/Login/codemap.ts +0 -49
  186. package/components/Login/core/withAD.tsx +0 -9
  187. package/components/Login/core/withAppQrcode.tsx +0 -49
  188. package/components/Login/core/withLDAP.tsx +0 -146
  189. package/components/Login/core/withPassword/FormItemAccount.tsx +0 -42
  190. package/components/Login/core/withPassword/GraphicVerifyCode.tsx +0 -30
  191. package/components/Login/core/withPassword/InputAccount.tsx +0 -64
  192. package/components/Login/core/withPassword/index.tsx +0 -173
  193. package/components/Login/core/withPhonecode.tsx +0 -122
  194. package/components/Login/core/withWechatMiniQrcode.tsx +0 -60
  195. package/components/Login/core/withWechatmpQrcode.tsx +0 -53
  196. package/components/Login/index.tsx +0 -374
  197. package/components/Login/props.ts +0 -74
  198. package/components/Login/socialLogin/index.tsx +0 -407
  199. package/components/Login/socialLogin/style.less +0 -69
  200. package/components/Login/styles.less +0 -53
  201. package/components/MFA/VerifyCodeInput/VerifyCodeFormItem.tsx +0 -41
  202. package/components/MFA/VerifyCodeInput/index.tsx +0 -145
  203. package/components/MFA/VerifyCodeInput/style.less +0 -35
  204. package/components/MFA/codemap.ts +0 -24
  205. package/components/MFA/core/email.tsx +0 -203
  206. package/components/MFA/core/face.tsx +0 -297
  207. package/components/MFA/core/face_deps.tsx +0 -37
  208. package/components/MFA/core/sms.tsx +0 -203
  209. package/components/MFA/core/totp.tsx +0 -122
  210. package/components/MFA/index.tsx +0 -143
  211. package/components/MFA/mfaMethods/index.tsx +0 -88
  212. package/components/MFA/mfaMethods/style.less +0 -39
  213. package/components/MFA/props.ts +0 -51
  214. package/components/MFA/styles.less +0 -100
  215. package/components/NeedHelpView/core/describeQuestions.tsx +0 -245
  216. package/components/NeedHelpView/index.tsx +0 -47
  217. package/components/RecoveryCode/core/useCode.tsx +0 -71
  218. package/components/RecoveryCode/index.tsx +0 -27
  219. package/components/RecoveryCode/interface.ts +0 -31
  220. package/components/RecoveryCode/style.less +0 -13
  221. package/components/Register/codemap.ts +0 -12
  222. package/components/Register/components/Agreements/index.tsx +0 -81
  223. package/components/Register/components/Agreements/style.less +0 -44
  224. package/components/Register/core/WithEmail.tsx +0 -242
  225. package/components/Register/core/WithPhone.tsx +0 -184
  226. package/components/Register/index.tsx +0 -139
  227. package/components/Register/props.ts +0 -50
  228. package/components/SendCode/SendCodeBtn.tsx +0 -96
  229. package/components/SendCode/index.tsx +0 -94
  230. package/components/SendCode/style.less +0 -31
  231. package/components/ShieldSpin/index.tsx +0 -27
  232. package/components/ShieldSpin/loading.svg +0 -29
  233. package/components/SubmitButton/index.tsx +0 -50
  234. package/components/SubmitSuccess/index.tsx +0 -66
  235. package/components/SubmitSuccess/interface.ts +0 -17
  236. package/components/Type/index.ts +0 -52
  237. package/components/ValidatorRules/ValidatorFormItem.tsx +0 -139
  238. package/components/ValidatorRules/index.ts +0 -20
  239. package/components/_utils/GuardErrorCode.ts +0 -9
  240. package/components/_utils/config.ts +0 -116
  241. package/components/_utils/guradHttp.ts +0 -101
  242. package/components/_utils/hooks/index.ts +0 -64
  243. package/components/assets/images/error.png +0 -0
  244. package/components/context/module/context.tsx +0 -23
  245. package/components/index.ts +0 -12
  246. package/examples.tsx +0 -87
  247. package/index.js +0 -1
  248. package/lib/static/media/loading.4a67a5f3.svg +0 -29
  249. package/scripts/publish.js +0 -57
package/scripts/test.js CHANGED
@@ -1,37 +1,40 @@
1
+ 'use strict';
2
+
1
3
  // Do this as the first thing so that any code reading it knows the right env.
2
- process.env.BABEL_ENV = 'test'
3
- process.env.NODE_ENV = 'test'
4
- process.env.PUBLIC_URL = ''
4
+ process.env.BABEL_ENV = 'test';
5
+ process.env.NODE_ENV = 'test';
6
+ process.env.PUBLIC_URL = '';
5
7
 
6
8
  // Makes the script crash on unhandled rejections instead of silently
7
9
  // ignoring them. In the future, promise rejections that are not handled will
8
10
  // terminate the Node.js process with a non-zero exit code.
9
- process.on('unhandledRejection', (err) => {
10
- throw err
11
- })
11
+ process.on('unhandledRejection', err => {
12
+ throw err;
13
+ });
12
14
 
13
15
  // Ensure environment variables are read.
14
- require('../config/env')
16
+ require('../config/env');
17
+
15
18
 
16
- const jest = require('jest')
17
- const execSync = require('child_process').execSync
18
- let argv = process.argv.slice(2)
19
+ const jest = require('jest');
20
+ const execSync = require('child_process').execSync;
21
+ let argv = process.argv.slice(2);
19
22
 
20
23
  function isInGitRepository() {
21
24
  try {
22
- execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' })
23
- return true
25
+ execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' });
26
+ return true;
24
27
  } catch (e) {
25
- return false
28
+ return false;
26
29
  }
27
30
  }
28
31
 
29
32
  function isInMercurialRepository() {
30
33
  try {
31
- execSync('hg --cwd . root', { stdio: 'ignore' })
32
- return true
34
+ execSync('hg --cwd . root', { stdio: 'ignore' });
35
+ return true;
33
36
  } catch (e) {
34
- return false
37
+ return false;
35
38
  }
36
39
  }
37
40
 
@@ -42,8 +45,9 @@ if (
42
45
  argv.indexOf('--watchAll=false') === -1
43
46
  ) {
44
47
  // https://github.com/facebook/create-react-app/issues/5210
45
- const hasSourceControl = isInGitRepository() || isInMercurialRepository()
46
- argv.push(hasSourceControl ? '--watch' : '--watchAll')
48
+ const hasSourceControl = isInGitRepository() || isInMercurialRepository();
49
+ argv.push(hasSourceControl ? '--watch' : '--watchAll');
47
50
  }
48
51
 
49
- jest.run(argv)
52
+
53
+ jest.run(argv);
@@ -1,6 +1,6 @@
1
1
  import { DownOutlined } from '@ant-design/icons'
2
2
  import React, { FC, useState } from 'react'
3
- import { getClassnames } from '../_utils'
3
+ import { getClassnames } from '../../utils'
4
4
 
5
5
  import './style.less'
6
6
 
@@ -2,7 +2,7 @@ import { Button } from 'antd'
2
2
  import React, { FC, useMemo } from 'react'
3
3
  import { EllipsisOutlined } from '@ant-design/icons'
4
4
 
5
- import { getClassnames } from '../_utils'
5
+ import { getClassnames } from '../../utils'
6
6
 
7
7
  import './style.less'
8
8
 
@@ -1,6 +1,6 @@
1
1
  import React, { FC, useCallback, useEffect, useRef, useState } from 'react'
2
2
  import { CopyOutlined, CheckOutlined } from '@ant-design/icons'
3
- import { copyToClipboard, getClassnames } from '../_utils'
3
+ import { copyToClipboard, getClassnames } from '../../utils'
4
4
 
5
5
  import './style.less'
6
6
  import { useTranslation } from 'react-i18next'
@@ -2,13 +2,13 @@ import { message } from 'antd'
2
2
  import { User } from 'authing-js-sdk'
3
3
  import React, { FC, useState } from 'react'
4
4
  import { useTranslation } from 'react-i18next'
5
- import { AuthingDropdown } from '../../AuthingDropdown'
5
+ import { AuthingDropdown } from 'src/common/AuthingDropdown'
6
6
 
7
7
  import {
8
8
  EmailMfaVerifyForm,
9
9
  SmsMfaVerifyForm,
10
10
  } from '../../../components/AuthingGuard/Forms'
11
- import { useGuardContext } from '../../context/global/context'
11
+ import { useGuardContext } from '../../../context/global/context'
12
12
  import { ApplicationMfaType, ApplicationMfaTypeLabel } from '../api'
13
13
 
14
14
  import './style.less'
@@ -1,6 +1,6 @@
1
1
  import React, { FC } from 'react'
2
2
  import { useTranslation } from 'react-i18next'
3
- import { useGuardContext } from '../../context/global/context'
3
+ import { useGuardContext } from '../../../context/global/context'
4
4
  import { CompleteUserInfoForm } from '../Forms/CompleteUserInfoForm'
5
5
 
6
6
  import './style.less'
@@ -3,14 +3,14 @@ import { FormInstance } from 'antd/lib/form'
3
3
  import { UserOutlined, LockOutlined } from '@ant-design/icons'
4
4
  import React, { forwardRef, useImperativeHandle, useState } from 'react'
5
5
 
6
- import { useGuardContext } from '../../../context/global/context'
6
+ import { getRequiredRules } from '../../../../utils'
7
+ import { useGuardContext } from '../../../../context/global/context'
7
8
  import {
8
9
  ADLoginFormProps,
9
10
  LoginMethods,
10
11
  } from '../../../../components/AuthingGuard/types'
11
12
  import { LoginFormFooter } from '../../../../components/AuthingGuard/Forms/LoginFormFooter'
12
13
  import { useTranslation } from 'react-i18next'
13
- import { getRequiredRules } from '../../../_utils'
14
14
 
15
15
  export const ADLoginForm = forwardRef<FormInstance, ADLoginFormProps>(
16
16
  ({ onSuccess, onValidateFail, onFail }, ref) => {
@@ -1,8 +1,8 @@
1
1
  import React, { FC, useState, useMemo, useEffect } from 'react'
2
2
  import { Space, Checkbox } from 'antd'
3
3
  import { Agreement } from '../../api'
4
+ import { getClassnames } from '../../../../utils'
4
5
  import './style.less'
5
- import { getClassnames } from '../../../_utils'
6
6
 
7
7
  export interface AgreementsProps {
8
8
  value?: boolean
@@ -1,13 +1,13 @@
1
1
  import { Button, Form, Input, message, Spin } from 'antd'
2
2
  import { useForm } from 'antd/lib/form/Form'
3
3
  import React, { FC, useEffect, useState } from 'react'
4
- import { useGuardContext } from '../../../context/global/context'
4
+ import { useGuardContext } from '../../../../context/global/context'
5
5
  import { User } from 'authing-js-sdk'
6
6
  import { UploadImage } from '../UploadImage'
7
- import { requestClient } from '../../../_utils/http'
7
+ import { requestClient } from '../../api/http'
8
8
  import { CompleteUserInfoFormProps } from '../../types'
9
9
  import { useTranslation } from 'react-i18next'
10
- import { i18n } from '../../../_utils/locales'
10
+ import { i18n } from '../../locales'
11
11
 
12
12
  export const CompleteUserInfoForm: FC<CompleteUserInfoFormProps> = ({
13
13
  onSuccess,
@@ -1,10 +1,12 @@
1
1
  import React, { FC, useState } from 'react'
2
2
  import { Button, Form, Input, message } from 'antd'
3
- import { useGuardContext } from '../../../context/global/context'
3
+
4
+ import { useGuardContext } from '../../../../context/global/context'
4
5
  import { MFACheckEmailFormProps } from '../../types'
6
+
5
7
  import './style.less'
8
+ import { VALIDATE_PATTERN } from '../../../../utils'
6
9
  import { useTranslation } from 'react-i18next'
7
- import { VALIDATE_PATTERN } from '../../../_utils'
8
10
 
9
11
  export const CheckEmailForm: FC<MFACheckEmailFormProps> = ({
10
12
  onSuccess,
@@ -2,8 +2,8 @@ import { EmailScene, User } from 'authing-js-sdk'
2
2
  import React, { FC, useState } from 'react'
3
3
  import { Button, Form } from 'antd'
4
4
 
5
- import { VerifyCodeInput } from '../../../VerifyCodeInput'
6
- import { useGuardContext } from '../../../context/global/context'
5
+ import { VerifyCodeInput } from '../../../../common/VerifyCodeInput'
6
+ import { useGuardContext } from '../../../../context/global/context'
7
7
  import { EmailMFAVerifyFormProps } from '../../../../components/AuthingGuard/types'
8
8
 
9
9
  import './style.less'
@@ -1,5 +1,5 @@
1
1
  import React, { FC, useRef, useState } from 'react'
2
- import { useGuardContext } from '../../../context/global/context'
2
+ import { useGuardContext } from 'src/context/global/context'
3
3
  import { CheckEmailForm } from './CheckEmailForm'
4
4
  import { VerifyCodeForm } from './VerifyCodeForm'
5
5
  import { SmsMFAFormProps } from '../../types'
@@ -8,8 +8,8 @@ import {
8
8
  getRequiredRules,
9
9
  getUserRegisterParams,
10
10
  VALIDATE_PATTERN,
11
- } from '../../../_utils'
12
- import { useGuardContext } from '../../../context/global/context'
11
+ } from '../../../../utils'
12
+ import { useGuardContext } from '../../../../context/global/context'
13
13
  import {
14
14
  EmailRegisterFormProps,
15
15
  RegisterMethods,
@@ -3,8 +3,8 @@ import { FormInstance } from 'antd/lib/form'
3
3
  import { UserOutlined, LockOutlined } from '@ant-design/icons'
4
4
  import React, { forwardRef, useImperativeHandle, useState } from 'react'
5
5
 
6
- import { getRequiredRules } from '../../../_utils'
7
- import { useGuardContext } from '../../../context/global/context'
6
+ import { getRequiredRules } from '../../../../utils'
7
+ import { useGuardContext } from '../../../../context/global/context'
8
8
  import { NEED_CAPTCHA } from '../../../../components/AuthingGuard/constants'
9
9
  import {
10
10
  LoginMethods,
@@ -18,8 +18,7 @@ export const LdapLoginForm = forwardRef<FormInstance, PasswordLoginFormProps>(
18
18
  const { t } = useTranslation()
19
19
 
20
20
  const { state } = useGuardContext()
21
- const { config, authClient, realHost, guardEvents } = state
22
- const autoRegister = config.autoRegister
21
+ const { authClient, realHost, guardEvents } = state
23
22
 
24
23
  const [rawForm] = Form.useForm()
25
24
 
@@ -68,12 +67,8 @@ export const LdapLoginForm = forwardRef<FormInstance, PasswordLoginFormProps>(
68
67
  try {
69
68
  const identity = values.identity && values.identity.trim()
70
69
  const password = values.password && values.password.trim()
71
- const captchaCode = values.captchaCode && values.captchaCode.trim()
72
70
 
73
- const user = await authClient.loginByLdap(identity, password, {
74
- autoRegister,
75
- captchaCode,
76
- })
71
+ const user = await authClient.loginByLdap(identity, password)
77
72
  onSuccess && onSuccess(user)
78
73
  } catch (error) {
79
74
  if (typeof error.message === 'string') {
@@ -1,6 +1,6 @@
1
1
  import { Button, Divider } from 'antd'
2
2
  import React, { FC } from 'react'
3
- import { useGuardContext } from '../../../context/global/context'
3
+ import { useGuardContext } from '../../../../context/global/context'
4
4
  import { GuardScenes } from '../../../../components/AuthingGuard/types'
5
5
  import './style.less'
6
6
  import { useTranslation } from 'react-i18next'
@@ -1,8 +1,8 @@
1
1
  import { Input, Form, Button } from 'antd'
2
2
  import React, { FC, useState } from 'react'
3
3
  import { LockOutlined } from '@ant-design/icons'
4
- import { getRequiredRules } from '../../../_utils'
5
- import { useGuardContext } from '../../../context/global/context'
4
+ import { getRequiredRules } from '../../../../utils'
5
+ import { useGuardContext } from '../../../../context/global/context'
6
6
  import { User } from 'authing-js-sdk'
7
7
  import { useTranslation } from 'react-i18next'
8
8
 
@@ -1,7 +1,7 @@
1
1
  import React, { FC } from 'react'
2
2
 
3
3
  import { Button, Checkbox, Form } from 'antd'
4
- import { CopyAbleText } from '../../../CopyAbleText'
4
+ import { CopyAbleText } from '../../../../common/CopyAbleText'
5
5
  import { useTranslation } from 'react-i18next'
6
6
 
7
7
  export interface MfaResetStep2Props {
@@ -3,7 +3,7 @@ import React, { FC, useState } from 'react'
3
3
 
4
4
  import { MfaResetStep1 } from './Step1'
5
5
  import { MfaResetStep2 } from './Step2'
6
- import { useGuardContext } from '../../../context/global/context'
6
+ import { useGuardContext } from '../../../../context/global/context'
7
7
  import { MfaResetForm } from '../../../../components/AuthingGuard/types'
8
8
 
9
9
  import './style.less'
@@ -2,8 +2,8 @@ import { User } from 'authing-js-sdk'
2
2
  import React, { FC, useState } from 'react'
3
3
  import { Button, Form } from 'antd'
4
4
 
5
- import { VerifyCodeInput } from '../../../VerifyCodeInput'
6
- import { useGuardContext } from '../../../context/global/context'
5
+ import { VerifyCodeInput } from '../../../../common/VerifyCodeInput'
6
+ import { useGuardContext } from '../../../../context/global/context'
7
7
  import { MfaVerifyForm } from '../../../../components/AuthingGuard/types'
8
8
 
9
9
  import './style.less'
@@ -8,8 +8,8 @@ import React, {
8
8
  useState,
9
9
  } from 'react'
10
10
 
11
- import { getRequiredRules, getUserRegisterParams } from '../../../_utils'
12
- import { useGuardContext } from '../../../context/global/context'
11
+ import { getRequiredRules, getUserRegisterParams } from '../../../../utils'
12
+ import { useGuardContext } from '../../../../context/global/context'
13
13
  import { NEED_CAPTCHA } from '../../../../components/AuthingGuard/constants'
14
14
  import {
15
15
  LoginMethods,
@@ -19,7 +19,7 @@ import {
19
19
  import { LoginFormFooter } from '../../../../components/AuthingGuard/Forms/LoginFormFooter'
20
20
  import { useTranslation } from 'react-i18next'
21
21
  import { PasswordLoginMethods } from '../../api'
22
- import { requestClient } from '../../../_utils/http'
22
+ import { requestClient } from '../../api/http'
23
23
 
24
24
  export const PasswordLoginForm = forwardRef<
25
25
  FormInstance,
@@ -7,8 +7,8 @@ import {
7
7
  getRequiredRules,
8
8
  getUserRegisterParams,
9
9
  VALIDATE_PATTERN,
10
- } from '../../../_utils'
11
- import { useGuardContext } from '../../../context/global/context'
10
+ } from '../../../../utils'
11
+ import { useGuardContext } from '../../../../context/global/context'
12
12
  import {
13
13
  LoginMethods,
14
14
  PhoneCodeLoginFormProps,
@@ -3,7 +3,7 @@ import { FormInstance } from 'antd/lib/form'
3
3
  import React, { forwardRef, useImperativeHandle, useState } from 'react'
4
4
  import { UserOutlined, LockOutlined, SafetyOutlined } from '@ant-design/icons'
5
5
 
6
- import { useGuardContext } from '../../../context/global/context'
6
+ import { useGuardContext } from '../../../../context/global/context'
7
7
  import {
8
8
  PhoneRegisterFormProps,
9
9
  RegisterMethods,
@@ -13,7 +13,7 @@ import {
13
13
  getRequiredRules,
14
14
  getUserRegisterParams,
15
15
  VALIDATE_PATTERN,
16
- } from '../../../_utils'
16
+ } from '../../../../utils'
17
17
  import { SendPhoneCode } from '../../../../components/AuthingGuard/Forms/SendPhoneCode'
18
18
  import { RegisterFormFooter } from '../../../../components/AuthingGuard/Forms/RegisterFormFooter'
19
19
  import { useTranslation } from 'react-i18next'
@@ -1,7 +1,7 @@
1
1
  import { Spin } from 'antd'
2
2
  import React, { FC, useEffect, useMemo, useRef } from 'react'
3
3
 
4
- import { useGuardContext } from '../../../context/global/context'
4
+ import { useGuardContext } from '../../../../context/global/context'
5
5
  import {
6
6
  LoginMethods,
7
7
  QrLoginFormProps,
@@ -14,6 +14,7 @@ export const QrCodeLoginForm: FC<QrLoginFormProps> = ({
14
14
  onFail,
15
15
  onSuccess,
16
16
  type,
17
+ idpId,
17
18
  }) => {
18
19
  const {
19
20
  state: { authClient, config },
@@ -31,6 +32,7 @@ export const QrCodeLoginForm: FC<QrLoginFormProps> = ({
31
32
 
32
33
  useEffect(() => {
33
34
  client.startScanning('authingGuardQrcode', {
35
+ extIdpConnId: idpId,
34
36
  autoExchangeUserInfo: true,
35
37
  ...config.qrCodeScanOptions,
36
38
  onStart(timer) {
@@ -46,7 +48,7 @@ export const QrCodeLoginForm: FC<QrLoginFormProps> = ({
46
48
  },
47
49
  })
48
50
  return () => clearInterval(timerRef.current)
49
- }, [client, config.qrCodeScanOptions, onFail, onSuccess])
51
+ }, [client, config.qrCodeScanOptions, idpId, onFail, onSuccess])
50
52
 
51
53
  return (
52
54
  <div className="authing-guard-qr-form">
@@ -1,6 +1,6 @@
1
1
  import { Button } from 'antd'
2
2
  import React, { FC } from 'react'
3
- import { useGuardContext } from '../../../context/global/context'
3
+ import { useGuardContext } from '../../../../context/global/context'
4
4
  import { GuardScenes } from '../../../../components/AuthingGuard/types'
5
5
 
6
6
  import './style.less'
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { Button } from 'antd'
3
3
 
4
- import { useGuardContext } from '../../../context/global/context'
4
+ import { useGuardContext } from '../../../../context/global/context'
5
5
  import { GuardScenes } from '../../../../components/AuthingGuard/types'
6
6
  import { useTranslation } from 'react-i18next'
7
7
 
@@ -1,12 +1,12 @@
1
1
  import React, { FC, useState } from 'react'
2
2
  import { Form, Input, Button, message } from 'antd'
3
3
 
4
- import { validate } from '../../../_utils'
4
+ import { validate } from '../../../../utils'
5
5
  import {
6
6
  ResetPasswordStep1Props,
7
7
  ResetPwdMethods,
8
8
  } from '../../../../components/AuthingGuard/types'
9
- import { useGuardContext } from '../../../context/global/context'
9
+ import { useGuardContext } from '../../../../context/global/context'
10
10
  import { EmailScene } from 'authing-js-sdk'
11
11
  import { useTranslation } from 'react-i18next'
12
12
 
@@ -2,8 +2,8 @@ import React, { FC, useState } from 'react'
2
2
  import { Form, Input, Button } from 'antd'
3
3
  import { SafetyOutlined, LockOutlined, UserOutlined } from '@ant-design/icons'
4
4
 
5
- import { getRequiredRules } from '../../../_utils'
6
- import { useGuardContext } from '../../../context/global/context'
5
+ import { getRequiredRules } from '../../../../utils'
6
+ import { useGuardContext } from '../../../../context/global/context'
7
7
  import { ResetPasswordStep2Props } from '../../../../components/AuthingGuard/types'
8
8
  import { SendPhoneCode } from '../../../../components/AuthingGuard/Forms/SendPhoneCode'
9
9
  import { useTranslation } from 'react-i18next'
@@ -3,8 +3,8 @@ import { Form, Button, Input, message } from 'antd'
3
3
  import { SafetyOutlined, LockOutlined } from '@ant-design/icons'
4
4
  import { EmailScene } from 'authing-js-sdk'
5
5
 
6
- import { getRequiredRules } from '../../../_utils'
7
- import { useGuardContext } from '../../../context/global/context'
6
+ import { getRequiredRules } from '../../../../utils'
7
+ import { useGuardContext } from '../../../../context/global/context'
8
8
  import { ResetPasswordStep3Props } from '../../../../components/AuthingGuard/types'
9
9
  import { useTranslation } from 'react-i18next'
10
10
 
@@ -1,4 +1,4 @@
1
- import { useGuardContext } from '../../../context/global/context'
1
+ import { useGuardContext } from '../../../../context/global/context'
2
2
  import React, { FC, useEffect, useRef, useState } from 'react'
3
3
 
4
4
  import { GuardScenes } from '../../../../components/AuthingGuard/types'
@@ -5,7 +5,7 @@ import { ResetPasswordStep2 } from './Step2'
5
5
  import { ResetPasswordStep3 } from './Step3'
6
6
  import { ResetPasswordStep4 } from './Step4'
7
7
  import { ResetPwdFormFooter } from './Footer'
8
- import { useGuardContext } from '../../../context/global/context'
8
+ import { useGuardContext } from '../../../../context/global/context'
9
9
  import { ResetPasswordFormProps } from '../../../../components/AuthingGuard/types'
10
10
 
11
11
  import './style.less'
@@ -3,8 +3,8 @@ import React, { FC } from 'react'
3
3
  import { CommonMessage } from 'authing-js-sdk'
4
4
 
5
5
  import { SendCodeBtn } from './SendCodeBtn'
6
- import { validate } from '../../../_utils'
7
- import { useGuardContext } from '../../../context/global/context'
6
+ import { validate } from '../../../../utils'
7
+ import { useGuardContext } from '../../../../context/global/context'
8
8
 
9
9
  import './style.less'
10
10
  import { useTranslation } from 'react-i18next'
@@ -1,11 +1,11 @@
1
1
  import React, { FC, useState } from 'react'
2
2
  import { Button, Form, Input, message } from 'antd'
3
3
 
4
- import { useGuardContext } from '../../../context/global/context'
4
+ import { useGuardContext } from '../../../../context/global/context'
5
5
  import { MFACheckPhoneFormProps } from '../../types'
6
6
 
7
7
  import './style.less'
8
- import { VALIDATE_PATTERN } from '../../../_utils'
8
+ import { VALIDATE_PATTERN } from '../../../../utils'
9
9
  import { useTranslation } from 'react-i18next'
10
10
 
11
11
  export const CheckPhoneForm: FC<MFACheckPhoneFormProps> = ({
@@ -2,8 +2,8 @@ import { User } from 'authing-js-sdk'
2
2
  import React, { FC, useState } from 'react'
3
3
  import { Button, Form } from 'antd'
4
4
 
5
- import { VerifyCodeInput } from '../../../VerifyCodeInput'
6
- import { useGuardContext } from '../../../context/global/context'
5
+ import { VerifyCodeInput } from '../../../../common/VerifyCodeInput'
6
+ import { useGuardContext } from '../../../../context/global/context'
7
7
  import { SmsMFAVerifyFormProps } from '../../../../components/AuthingGuard/types'
8
8
 
9
9
  import './style.less'
@@ -1,5 +1,5 @@
1
1
  import React, { FC, useRef, useState } from 'react'
2
- import { useGuardContext } from '../../../context/global/context'
2
+ import { useGuardContext } from 'src/context/global/context'
3
3
  import { CheckPhoneForm } from './CheckPhoneForm'
4
4
  import { VerifyCodeForm } from './VerifyCodeForm'
5
5
  import { SmsMFAFormProps } from '../../types'
@@ -3,8 +3,8 @@ import shortid from 'shortid'
3
3
  import React, { FC, useEffect } from 'react'
4
4
  import { Button, Avatar, Space, Tooltip, message } from 'antd'
5
5
 
6
- import { isWechatBrowser, popupCenter } from '../../../_utils'
7
- import { useGuardContext } from '../../../context/global/context'
6
+ import { isWechatBrowser, popupCenter } from '../../../../utils'
7
+ import { useGuardContext } from '../../../../context/global/context'
8
8
  import {
9
9
  APP_MFA_CODE,
10
10
  OTP_MFA_CODE,
@@ -21,14 +21,14 @@ import {
21
21
  IAzureAdConnectionConfig,
22
22
  IOAuthConnectionConfig,
23
23
  } from '../../../../components/AuthingGuard/api'
24
- import { requestClient } from '../../../_utils/http'
24
+ import { requestClient } from '../../api/http'
25
25
 
26
26
  import './style.less'
27
27
  import { IconFont } from '../../IconFont'
28
28
  import { useScreenSize } from '../../hooks/useScreenSize'
29
29
  import { SocialConnectionProvider } from 'authing-js-sdk'
30
30
  import { useTranslation } from 'react-i18next'
31
- import { i18n } from '../../../_utils/locales'
31
+ import { i18n } from '../../locales'
32
32
 
33
33
  export const SocialAndIdpLogin: FC<SocialAndIdpLoginProps> = ({
34
34
  onFail = () => {},
@@ -218,7 +218,7 @@ export const SocialAndIdpLogin: FC<SocialAndIdpLoginProps> = ({
218
218
  }
219
219
 
220
220
  const onLogin = () => {
221
- authClient.social.authorize(item.provider, {
221
+ authClient.social.authorize(item.identifier, {
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.name}
257
+ {item.tooltip?.[i18n.language as Lang] || item.displayName}
258
258
  </Button>
259
259
  ) : (
260
260
  <Tooltip
261
261
  key={item.provider}
262
- title={item.tooltip?.[i18n.language as Lang] || item.name}
262
+ title={item.tooltip?.[i18n.language as Lang] || item.displayName}
263
263
  >
264
264
  <div className="authing-social-login-item" onClick={onLogin}>
265
265
  <IconFont type={iconType} />