@authing/react-ui-components 3.0.2-beta.3 → 3.0.2-beta.7
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/build/asset-manifest.json +18 -18
- package/build/index.html +1 -1
- package/build/static/css/2.5c23c9b8.chunk.css +3 -0
- package/build/static/css/2.5c23c9b8.chunk.css.map +1 -0
- package/build/static/css/main.6a8701e8.chunk.css +2 -0
- package/build/static/css/main.6a8701e8.chunk.css.map +1 -0
- package/build/static/js/2.142555a1.chunk.js +3 -0
- package/build/static/js/{2.1105ecfb.chunk.js.LICENSE.txt → 2.142555a1.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/2.142555a1.chunk.js.map +1 -0
- package/build/static/js/{3.fd17f196.chunk.js → 3.ed27e06b.chunk.js} +2 -2
- package/build/static/js/{3.fd17f196.chunk.js.map → 3.ed27e06b.chunk.js.map} +1 -1
- package/build/static/js/main.8d075e4d.chunk.js +2 -0
- package/build/static/js/main.8d075e4d.chunk.js.map +1 -0
- package/build/static/js/{runtime-main.ef138021.js → runtime-main.9a428724.js} +2 -2
- package/build/static/js/{runtime-main.ef138021.js.map → runtime-main.9a428724.js.map} +1 -1
- package/components/BindTotp/interface.ts +1 -1
- package/components/ChangePassword/core/firstLoginReset.tsx +14 -7
- package/components/ChangePassword/core/rotateReset.tsx +19 -8
- package/components/ChangePassword/index.tsx +21 -8
- package/components/CompleteInfo/interface.ts +1 -1
- package/components/Guard/Guard.tsx +99 -59
- package/components/Guard/config.ts +2 -2
- package/components/Guard/event.ts +2 -2
- package/components/Guard/stateMachine.ts +19 -0
- package/components/Login/codemap.ts +3 -1
- package/components/Login/core/withPassword/index.tsx +3 -3
- package/components/Login/index.tsx +6 -5
- package/components/Login/{props.ts → interface.ts} +0 -0
- package/components/Login/socialLogin/index.tsx +1 -1
- package/components/MFA/core/email.tsx +1 -1
- package/components/MFA/core/sms.tsx +1 -1
- package/components/MFA/core/totp.tsx +1 -1
- package/components/MFA/index.tsx +1 -1
- package/components/MFA/{props.ts → interface.ts} +0 -0
- package/components/MFA/mfaMethods/index.tsx +1 -1
- package/components/Register/index.tsx +1 -1
- package/components/Register/{props.ts → interface.ts} +0 -0
- package/components/_utils/config.ts +2 -4
- package/components/_utils/guradHttp.ts +4 -0
- package/components/_utils/index.ts +5 -1
- package/components/_utils/locales/en/common.json +3 -1
- package/components/_utils/locales/zh/common.json +3 -1
- package/components/_utils/locales/zh/user.json +1 -0
- package/components/index.ts +4 -7
- package/examples.tsx +35 -35
- package/package.json +1 -1
- package/.vscode/settings.json +0 -31
- package/build/static/css/2.9512539b.chunk.css +0 -3
- package/build/static/css/2.9512539b.chunk.css.map +0 -1
- package/build/static/css/main.0ff9e24a.chunk.css +0 -2
- package/build/static/css/main.0ff9e24a.chunk.css.map +0 -1
- package/build/static/js/2.1105ecfb.chunk.js +0 -3
- package/build/static/js/2.1105ecfb.chunk.js.map +0 -1
- package/build/static/js/main.a47645ff.chunk.js +0 -2
- package/build/static/js/main.a47645ff.chunk.js.map +0 -1
- package/lib/index.d.ts +0 -2278
- package/lib/index.min.css +0 -2
- package/lib/index.min.js +0 -2
- package/lib/index.min.js.LICENSE.txt +0 -69
- package/lib/static/media/loading.4a67a5f3.svg +0 -29
|
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next'
|
|
|
4
4
|
import { useAsyncFn } from 'react-use'
|
|
5
5
|
import { GuardModuleType } from '../../Guard/module'
|
|
6
6
|
import { useGuardHttp } from '../../_utils/guradHttp'
|
|
7
|
-
import { GuardMFAInitData, MFAConfig } from '../
|
|
7
|
+
import { GuardMFAInitData, MFAConfig } from '../interface'
|
|
8
8
|
import { message as Message } from 'antd'
|
|
9
9
|
import SubmitButton from '../../SubmitButton'
|
|
10
10
|
import { VerifyCodeFormItem } from '../VerifyCodeInput/VerifyCodeFormItem'
|
package/components/MFA/index.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { MFASms } from './core/sms'
|
|
|
7
7
|
import { MFAFace } from './core/face'
|
|
8
8
|
import { MFATotp } from './core/totp'
|
|
9
9
|
import { MFAMethods } from './mfaMethods'
|
|
10
|
-
import { GuardMFAViewProps, MFAType } from './
|
|
10
|
+
import { GuardMFAViewProps, MFAType } from './interface'
|
|
11
11
|
import { useAuthClient } from '../Guard/authClient'
|
|
12
12
|
import { codeMap } from './codemap'
|
|
13
13
|
import './styles.less'
|
|
File without changes
|
|
@@ -2,7 +2,7 @@ import React, { useMemo, useState } from 'react'
|
|
|
2
2
|
import { useTranslation } from 'react-i18next'
|
|
3
3
|
import { Button } from 'antd'
|
|
4
4
|
import { IconFont } from '../../IconFont'
|
|
5
|
-
import { GuardMFAInitData, MFAType } from '../
|
|
5
|
+
import { GuardMFAInitData, MFAType } from '../interface'
|
|
6
6
|
import { i18n } from '../../_utils/locales'
|
|
7
7
|
import './style.less'
|
|
8
8
|
|
|
@@ -7,7 +7,7 @@ import { useAuthClient } from '../Guard/authClient'
|
|
|
7
7
|
import { GuardModuleType } from '../Guard/module'
|
|
8
8
|
import { RegisterWithEmail } from './core/WithEmail'
|
|
9
9
|
import { RegisterWithPhone } from './core/WithPhone'
|
|
10
|
-
import { GuardRegisterViewProps } from './
|
|
10
|
+
import { GuardRegisterViewProps } from './interface'
|
|
11
11
|
import { codeMap } from './codemap'
|
|
12
12
|
|
|
13
13
|
export const GuardRegisterView: React.FC<GuardRegisterViewProps> = ({
|
|
File without changes
|
|
@@ -18,8 +18,7 @@ export const initConfig = async (
|
|
|
18
18
|
config: Partial<IG2Config>,
|
|
19
19
|
defaultConfig: IG2Config
|
|
20
20
|
): Promise<{ config: GuardLocalConfig; publicConfig: ApplicationConfig }> => {
|
|
21
|
-
if (!getPublicConfig(appId))
|
|
22
|
-
await requestPublicConfig(appId, config.host ?? defaultConfig.host)
|
|
21
|
+
if (!getPublicConfig(appId)) await requestPublicConfig(appId)
|
|
23
22
|
const mergedConfig = mergeConfig(
|
|
24
23
|
config,
|
|
25
24
|
defaultConfig,
|
|
@@ -93,8 +92,7 @@ const mergeConfig = (
|
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
const requestPublicConfig = async (
|
|
96
|
-
appId: string
|
|
97
|
-
host: string
|
|
95
|
+
appId: string
|
|
98
96
|
): Promise<ApplicationConfig> => {
|
|
99
97
|
let res: AuthingResponse<ApplicationConfig>
|
|
100
98
|
|
|
@@ -198,9 +198,13 @@ export const assembledAppHost = (identifier: string, host: string) => {
|
|
|
198
198
|
|
|
199
199
|
const splitHost = hostUrl.hostname.split('.')
|
|
200
200
|
|
|
201
|
+
const port = hostUrl.port
|
|
202
|
+
|
|
201
203
|
splitHost.shift()
|
|
202
204
|
|
|
203
|
-
return `${hostUrl.protocol}//${identifier}.${splitHost.join('.')}
|
|
205
|
+
return `${hostUrl.protocol}//${identifier}.${splitHost.join('.')}${
|
|
206
|
+
port && `:${port}`
|
|
207
|
+
}`
|
|
204
208
|
}
|
|
205
209
|
|
|
206
210
|
export enum PasswordStrength {
|
|
@@ -223,5 +223,7 @@
|
|
|
223
223
|
"pToLogin": "seconds later back",
|
|
224
224
|
"resetSuccess": "Reset successfully",
|
|
225
225
|
"resetSuccessMessage": "The password is reset successfully, you can continue to log in with the new password",
|
|
226
|
-
"totpCode": "Security code"
|
|
226
|
+
"totpCode": "Security code",
|
|
227
|
+
"welcome": "Welcome",
|
|
228
|
+
"initPasswordText": "To ensure account security, please set your initial password."
|
|
227
229
|
}
|
package/components/index.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
export * from './_utils/config'
|
|
2
|
+
export type { AuthenticationClientOptions } from 'authing-js-sdk'
|
|
3
|
+
|
|
1
4
|
export * from './AuthingGuard/types'
|
|
2
5
|
export * from './AuthingGuard/hooks'
|
|
3
|
-
export
|
|
6
|
+
export * from './AuthingGuard'
|
|
4
7
|
|
|
5
8
|
export * from './Guard'
|
|
6
9
|
export * from './Type'
|
|
7
|
-
export * from './BindTotp/interface'
|
|
8
|
-
export * from './CompleteInfo/interface'
|
|
9
|
-
export * from './DownloadAuthenticator/interface'
|
|
10
|
-
export * from './Error/interface'
|
|
11
|
-
export * from './ForgetPassword/interface'
|
|
12
|
-
export * from './_utils/config'
|
package/examples.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import ReactDOM from 'react-dom'
|
|
|
3
3
|
|
|
4
4
|
import reportWebVitals from './reportWebVitals'
|
|
5
5
|
import { message } from 'antd'
|
|
6
|
-
import { Guard } from './components
|
|
6
|
+
import { Guard } from './components'
|
|
7
7
|
|
|
8
8
|
const App = () => {
|
|
9
9
|
return (
|
|
@@ -15,8 +15,9 @@ const App = () => {
|
|
|
15
15
|
}}
|
|
16
16
|
>
|
|
17
17
|
<Guard
|
|
18
|
-
appId="
|
|
19
|
-
//
|
|
18
|
+
appId="619747787da1b9eb2e9ee7d5"
|
|
19
|
+
// appId="6191cf610f772aa56dc70637"
|
|
20
|
+
// tenantId="6194a41abf23c1d5268b362a1"
|
|
20
21
|
onLogin={(u) => {
|
|
21
22
|
message.info('🏁 用户业务层终点,登录完成。')
|
|
22
23
|
console.log(u)
|
|
@@ -42,38 +43,37 @@ const App = () => {
|
|
|
42
43
|
onRegisterTabChange={(registerMethod) => {
|
|
43
44
|
console.log('📁 onRegisterTabChange 触发', registerMethod)
|
|
44
45
|
}}
|
|
45
|
-
config={
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
46
|
+
config={{
|
|
47
|
+
// host: 'https://core.dev2.authing-inc.co/',
|
|
48
|
+
host: 'http://core.authing.localhost:3000/',
|
|
49
|
+
// registerMethods: [RegisterMethods.Email],
|
|
50
|
+
// autoRegister: true,
|
|
51
|
+
// defaultRegisterMethod: RegisterMethods.Phone,
|
|
52
|
+
// disableRegister: false,
|
|
53
|
+
// disableResetPwd: false,
|
|
54
|
+
// defaultLoginMethod: LoginMethods.WxMinQr, // 指定默认登录方式,如果这个方式不存在于 LoginMethods,那么就当作没有传入
|
|
55
|
+
// loginMethods: [],
|
|
56
|
+
// LoginMethods.Password,
|
|
57
|
+
// LoginMethods.PhoneCode,
|
|
58
|
+
// LoginMethods.WxMinQr,
|
|
59
|
+
// ],
|
|
60
|
+
// socialConnections: [
|
|
61
|
+
// SocialConnectionProvider.ALIPAY,
|
|
62
|
+
// SocialConnectionProvider.APPLE_WEB,
|
|
63
|
+
// ], // 指定可选的社会化登录方式
|
|
64
|
+
// qrCodeScanOptions?: Parameters<QrCodeAuthenticationClient['startScanning']>[1]
|
|
65
|
+
// passwordLoginMethods?: PasswordLoginMethods[]
|
|
66
|
+
// enterpriseConnections: [] // 这个有啥用?
|
|
67
|
+
// publicKey?: string
|
|
68
|
+
// lang: 'en-US',
|
|
69
|
+
// lang: 'zh-CN',
|
|
70
|
+
// mode: GuardMode.Modal,
|
|
71
|
+
// logo: '',
|
|
72
|
+
// clickCloseable: false, // clickCloseable Modal 模式时是否隐藏登录框右上角的关闭按钮
|
|
73
|
+
// escCloseable: true, //
|
|
74
|
+
// target: '#c1',
|
|
75
|
+
// socialConnectionsBtnShape: 'rectangle',
|
|
76
|
+
}}
|
|
77
77
|
/>
|
|
78
78
|
</div>
|
|
79
79
|
)
|
package/package.json
CHANGED
package/.vscode/settings.json
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"eslint.validate": [
|
|
3
|
-
"javascript",
|
|
4
|
-
"javascriptreact",
|
|
5
|
-
"typescript",
|
|
6
|
-
"typescriptreact"
|
|
7
|
-
],
|
|
8
|
-
"files.associations": {
|
|
9
|
-
"*.mw.json": "jsonc",
|
|
10
|
-
"*.icon": "xml"
|
|
11
|
-
},
|
|
12
|
-
"cssModules.camelCase": true,
|
|
13
|
-
"editor.snippetSuggestions": "top",
|
|
14
|
-
"emmet.showSuggestionsAsSnippets": true,
|
|
15
|
-
"editor.formatOnSave": true,
|
|
16
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
17
|
-
"typescript.tsdk": "node_modules/typescript/lib",
|
|
18
|
-
"editor.codeActionsOnSave": {
|
|
19
|
-
"source.fixAll": true
|
|
20
|
-
},
|
|
21
|
-
"prettier.printWidth": 120,
|
|
22
|
-
"prettier.singleQuote": false,
|
|
23
|
-
"prettier.semi": true,
|
|
24
|
-
"i18n-ally.localesPaths": "components/_utils/locales",
|
|
25
|
-
"i18n-ally.displayLanguage": "zh",
|
|
26
|
-
"i18n-ally.keystyle": "nested",
|
|
27
|
-
"i18n-ally.annotations": true,
|
|
28
|
-
"i18n-ally.extract.targetPickingStrategy": "file-previous",
|
|
29
|
-
"i18n-ally.namespace": true,
|
|
30
|
-
"i18n-ally.sourceLanguage": "zh"
|
|
31
|
-
}
|