@authing/react-ui-components 2.4.54-alpha.0 → 2.4.56
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 +19 -18
- package/build/index.html +1 -1
- package/build/static/css/2.51c07e65.chunk.css +3 -0
- package/build/static/css/2.51c07e65.chunk.css.map +1 -0
- package/build/static/css/main.779f221a.chunk.css +2 -0
- package/build/static/css/main.779f221a.chunk.css.map +1 -0
- package/build/static/js/2.bbae9fdb.chunk.js +3 -0
- package/build/static/js/2.bbae9fdb.chunk.js.LICENSE.txt +102 -0
- package/build/static/js/2.bbae9fdb.chunk.js.map +1 -0
- package/build/static/js/{3.edcab7cd.chunk.js → 3.fd17f196.chunk.js} +2 -2
- package/build/static/js/3.fd17f196.chunk.js.map +1 -0
- package/build/static/js/main.5f341531.chunk.js +2 -0
- package/build/static/js/main.5f341531.chunk.js.map +1 -0
- package/build/static/js/runtime-main.ef138021.js +2 -0
- package/build/static/js/runtime-main.ef138021.js.map +1 -0
- package/build/static/media/loading.4a67a5f3.svg +29 -0
- package/lib/index.d.ts +14 -159
- package/lib/index.min.css +1 -2
- package/lib/index.min.js +1 -1
- package/lib/index.min.js.LICENSE.txt +8 -63
- package/package.json +3 -4
- package/src/common/AuthingDropdown/index.tsx +20 -58
- package/src/common/AuthingDropdown/style.less +8 -33
- package/src/components/AuthingGuard/AppMFALayout/index.tsx +15 -30
- package/src/components/AuthingGuard/GuardLayout/index.tsx +10 -32
- package/src/components/AuthingGuard/GuardLayout/style.less +0 -4
- package/src/components/AuthingGuard/Header/index.tsx +5 -2
- package/src/components/AuthingGuard/Header/style.less +23 -11
- package/src/components/AuthingGuard/IconFont/iconfont.js +74 -1
- package/src/components/AuthingGuard/api/appConfig.ts +2 -2
- package/src/components/AuthingGuard/api/http.ts +32 -9
- package/src/components/AuthingGuard/constants.ts +2 -0
- package/src/components/AuthingGuard/hooks/index.tsx +0 -37
- package/src/components/AuthingGuard/index.tsx +8 -3
- package/src/components/AuthingGuard/locales/en/common.json +1 -2
- package/src/components/AuthingGuard/locales/en/login.json +1 -1
- package/src/components/AuthingGuard/locales/zh/common.json +1 -16
- package/src/components/AuthingGuard/style.less +1 -0
- package/src/components/AuthingGuard/types/Forms.ts +0 -2
- package/src/components/AuthingGuard/types/GuardConfig.ts +1 -1
- package/src/context/global/reducer.tsx +0 -4
- package/src/index.tsx +16 -28
- package/src/utils/index.ts +0 -23
- package/build/static/css/2.40c24d2f.chunk.css +0 -2
- package/build/static/css/2.40c24d2f.chunk.css.map +0 -1
- package/build/static/css/main.ee0e3901.chunk.css +0 -2
- package/build/static/css/main.ee0e3901.chunk.css.map +0 -1
- package/build/static/js/2.354276b9.chunk.js +0 -3
- package/build/static/js/2.354276b9.chunk.js.LICENSE.txt +0 -156
- package/build/static/js/2.354276b9.chunk.js.map +0 -1
- package/build/static/js/3.edcab7cd.chunk.js.map +0 -1
- package/build/static/js/main.6c028b56.chunk.js +0 -2
- package/build/static/js/main.6c028b56.chunk.js.map +0 -1
- package/build/static/js/runtime-main.1b4b9135.js +0 -2
- package/build/static/js/runtime-main.1b4b9135.js.map +0 -1
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/AppDownload.tsx +0 -198
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/BindSuccess.tsx +0 -48
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/CopyIcon.tsx +0 -52
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/InputSaftyCode.tsx +0 -25
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/SaveSecretKey.tsx +0 -34
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/ScanQrcode.tsx +0 -44
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/index.tsx +0 -40
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/BindTotpForm/styles.less +0 -454
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/MobileSteps/index.tsx +0 -49
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/MobileSteps/style.less +0 -10
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/UserMfa/index.tsx +0 -361
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/UserMfa/style.less +0 -12
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/VerifyTotpForm.tsx +0 -120
- package/src/components/AuthingGuard/Forms/TotpMfaVerifyForm/index.tsx +0 -35
|
@@ -4,69 +4,14 @@
|
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/*!**************************!*\
|
|
16
|
-
!*** ./lib/version.json ***!
|
|
17
|
-
\**************************/
|
|
18
|
-
|
|
19
|
-
/*!*****************************!*\
|
|
20
|
-
!*** ./lib/lib/jsbn/rng.js ***!
|
|
21
|
-
\*****************************/
|
|
22
|
-
|
|
23
|
-
/*!*****************************!*\
|
|
24
|
-
!*** ./lib/lib/jsbn/rsa.js ***!
|
|
25
|
-
\*****************************/
|
|
26
|
-
|
|
27
|
-
/*!******************************!*\
|
|
28
|
-
!*** ./lib/lib/jsbn/jsbn.js ***!
|
|
29
|
-
\******************************/
|
|
30
|
-
|
|
31
|
-
/*!******************************!*\
|
|
32
|
-
!*** ./lib/lib/jsbn/util.js ***!
|
|
33
|
-
\******************************/
|
|
34
|
-
|
|
35
|
-
/*!*******************************!*\
|
|
36
|
-
!*** ./lib/lib/asn1js/hex.js ***!
|
|
37
|
-
\*******************************/
|
|
38
|
-
|
|
39
|
-
/*!*******************************!*\
|
|
40
|
-
!*** ./lib/lib/jsbn/prng4.js ***!
|
|
41
|
-
\*******************************/
|
|
42
|
-
|
|
43
|
-
/*!********************************!*\
|
|
44
|
-
!*** ./lib/JSEncryptRSAKey.js ***!
|
|
45
|
-
\********************************/
|
|
46
|
-
|
|
47
|
-
/*!********************************!*\
|
|
48
|
-
!*** ./lib/lib/asn1js/asn1.js ***!
|
|
49
|
-
\********************************/
|
|
50
|
-
|
|
51
|
-
/*!********************************!*\
|
|
52
|
-
!*** ./lib/lib/jsbn/base64.js ***!
|
|
53
|
-
\********************************/
|
|
54
|
-
|
|
55
|
-
/*!*********************************!*\
|
|
56
|
-
!*** ./lib/lib/asn1js/int10.js ***!
|
|
57
|
-
\*********************************/
|
|
58
|
-
|
|
59
|
-
/*!**********************************!*\
|
|
60
|
-
!*** ./lib/lib/asn1js/base64.js ***!
|
|
61
|
-
\**********************************/
|
|
62
|
-
|
|
63
|
-
/*!************************************!*\
|
|
64
|
-
!*** ./lib/lib/jsrsasign/yahoo.js ***!
|
|
65
|
-
\************************************/
|
|
66
|
-
|
|
67
|
-
/*!***************************************!*\
|
|
68
|
-
!*** ./lib/lib/jsrsasign/asn1-1.0.js ***!
|
|
69
|
-
\***************************************/
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Lodash <https://lodash.com/>
|
|
10
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
11
|
+
* Released under MIT license <https://lodash.com/license>
|
|
12
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
13
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
14
|
+
*/
|
|
70
15
|
|
|
71
16
|
/** @license React v16.13.1
|
|
72
17
|
* react-is.production.min.js
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authing/react-ui-components",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.56",
|
|
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.
|
|
10
|
-
"globalthis": "^1.0.2",
|
|
9
|
+
"authing-js-sdk": "4.22.24-alpha",
|
|
11
10
|
"qs": "^6.9.4"
|
|
12
11
|
},
|
|
13
12
|
"peerDependencies": {
|
|
@@ -186,5 +185,5 @@
|
|
|
186
185
|
"webpack-manifest-plugin": "2.2.0",
|
|
187
186
|
"workbox-webpack-plugin": "5.1.4"
|
|
188
187
|
},
|
|
189
|
-
"gitHead": "
|
|
188
|
+
"gitHead": "2504bd53f585359d71ceef42890227eea51aba0d"
|
|
190
189
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DownOutlined } from '@ant-design/icons'
|
|
2
|
-
import React, { FC,
|
|
3
|
-
import { createPortal } from 'react-dom'
|
|
2
|
+
import React, { FC, useState } from 'react'
|
|
4
3
|
import { getClassnames } from '../../utils'
|
|
5
4
|
|
|
6
5
|
import './style.less'
|
|
@@ -21,69 +20,32 @@ export const AuthingDropdown: FC<{
|
|
|
21
20
|
}> = ({ menus, children, className }) => {
|
|
22
21
|
const [visible, setVisible] = useState(false)
|
|
23
22
|
|
|
24
|
-
const triggerRef = useRef<HTMLDivElement>(null)
|
|
25
|
-
|
|
26
|
-
const [top, setTop] = useState<number>()
|
|
27
|
-
const [left, setLeft] = useState<number>()
|
|
28
|
-
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
const global = require('globalthis')()
|
|
31
|
-
|
|
32
|
-
const changePosition = () => {
|
|
33
|
-
const value = triggerRef.current?.getBoundingClientRect()
|
|
34
|
-
value && setTop(value?.top + value?.height)
|
|
35
|
-
value && setLeft(value?.left)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
changePosition()
|
|
39
|
-
global?.window.addEventListener('scroll', changePosition)
|
|
40
|
-
global?.window.addEventListener('DOMNodeInserted', changePosition)
|
|
41
|
-
global?.window.addEventListener('DOMNodeRemoved', changePosition)
|
|
42
|
-
global.window.onresize = changePosition
|
|
43
|
-
return () => {
|
|
44
|
-
global?.window.removeEventListener('scroll', changePosition)
|
|
45
|
-
global?.window.removeEventListener('DOMNodeInserted', changePosition)
|
|
46
|
-
global?.window.removeEventListener('DOMNodeRemoved', changePosition)
|
|
47
|
-
}
|
|
48
|
-
}, [])
|
|
49
|
-
|
|
50
23
|
return (
|
|
51
|
-
// TODO
|
|
52
|
-
// 没有下拉 与回收的动效,暂时没有时间搞,之后优化
|
|
53
24
|
<div
|
|
54
25
|
className={getClassnames(['authing-dropdown', className])}
|
|
55
26
|
onMouseEnter={() => setVisible(true)}
|
|
56
27
|
onMouseLeave={() => setVisible(false)}
|
|
57
28
|
>
|
|
58
|
-
<div
|
|
59
|
-
|
|
29
|
+
<div className="authing-dropdown-trigger">{children}</div>
|
|
30
|
+
<div
|
|
31
|
+
className={getClassnames([
|
|
32
|
+
'authing-dropdown-menu-container',
|
|
33
|
+
visible && 'authing-dropdown-menu-container__visible',
|
|
34
|
+
])}
|
|
35
|
+
>
|
|
36
|
+
{menus.map((item) => (
|
|
37
|
+
<div
|
|
38
|
+
className="authing-dropdown-menu-item"
|
|
39
|
+
onClick={(evt) => {
|
|
40
|
+
setVisible(false)
|
|
41
|
+
item.onClick?.(item.key, evt)
|
|
42
|
+
}}
|
|
43
|
+
key={item.key}
|
|
44
|
+
>
|
|
45
|
+
{item.label}
|
|
46
|
+
</div>
|
|
47
|
+
))}
|
|
60
48
|
</div>
|
|
61
|
-
{visible
|
|
62
|
-
? createPortal(
|
|
63
|
-
<div
|
|
64
|
-
data-id="authing-dropdown-menu"
|
|
65
|
-
className={getClassnames(['authing-dropdown-menu-container'])}
|
|
66
|
-
style={{
|
|
67
|
-
top: top,
|
|
68
|
-
left: left,
|
|
69
|
-
}}
|
|
70
|
-
>
|
|
71
|
-
{menus.map((item) => (
|
|
72
|
-
<div
|
|
73
|
-
className="authing-dropdown-menu-item"
|
|
74
|
-
onClick={(evt) => {
|
|
75
|
-
setVisible(false)
|
|
76
|
-
item.onClick?.(item.key, evt)
|
|
77
|
-
}}
|
|
78
|
-
key={item.key}
|
|
79
|
-
>
|
|
80
|
-
{item.label}
|
|
81
|
-
</div>
|
|
82
|
-
))}
|
|
83
|
-
</div>,
|
|
84
|
-
document.body
|
|
85
|
-
)
|
|
86
|
-
: null}
|
|
87
49
|
<DownOutlined className="authing-dropdown-icon" />
|
|
88
50
|
</div>
|
|
89
51
|
)
|
|
@@ -9,50 +9,25 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.authing-dropdown-menu-container {
|
|
12
|
-
height:
|
|
13
|
-
opacity:
|
|
14
|
-
pointer-events: unset;
|
|
12
|
+
height: 0;
|
|
13
|
+
opacity: 0;
|
|
15
14
|
position: absolute;
|
|
16
15
|
top: 100%;
|
|
17
16
|
left: 0;
|
|
18
|
-
|
|
17
|
+
transition: all 0.3s;
|
|
19
18
|
cursor: pointer;
|
|
20
19
|
background-color: #fff;
|
|
21
20
|
padding: 4px 0;
|
|
22
21
|
border-radius: 2px;
|
|
23
22
|
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
24
23
|
0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
25
|
-
|
|
26
|
-
@keyframes slide-down {
|
|
27
|
-
0% {
|
|
28
|
-
transform: scale(1, 0);
|
|
29
|
-
}
|
|
30
|
-
100% {
|
|
31
|
-
transform: scale(1, 1);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@-webkit-keyframes slide-down {
|
|
36
|
-
0% {
|
|
37
|
-
-webkit-transform: scale(1, 0);
|
|
38
|
-
}
|
|
39
|
-
100% {
|
|
40
|
-
-webkit-transform: scale(1, 1);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.authing-dropdown-menu-container_show {
|
|
45
|
-
max-height: auto;
|
|
46
|
-
transition: max-height 0.3s ease-in;
|
|
47
|
-
transform-origin: 50% 0;
|
|
48
|
-
animation: slide-down 0.3s ease-in;
|
|
49
|
-
-webkit-animation: slide-down 0.3s ease-in;
|
|
24
|
+
pointer-events: none;
|
|
50
25
|
}
|
|
51
26
|
|
|
52
|
-
.authing-dropdown-menu-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
27
|
+
.authing-dropdown-menu-container__visible {
|
|
28
|
+
height: auto;
|
|
29
|
+
opacity: 1;
|
|
30
|
+
pointer-events: unset;
|
|
56
31
|
}
|
|
57
32
|
|
|
58
33
|
.authing-dropdown-menu-item {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { message } from 'antd'
|
|
2
2
|
import { User } from 'authing-js-sdk'
|
|
3
|
-
import React, { FC,
|
|
3
|
+
import React, { FC, useState } from 'react'
|
|
4
4
|
import { useTranslation } from 'react-i18next'
|
|
5
5
|
import { AuthingDropdown } from 'src/common/AuthingDropdown'
|
|
6
6
|
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
} from '../../../components/AuthingGuard/Forms'
|
|
11
11
|
import { useGuardContext } from '../../../context/global/context'
|
|
12
12
|
import { ApplicationMfaType, ApplicationMfaTypeLabel } from '../api'
|
|
13
|
-
import { TotpMfaVerifyForm } from '../Forms/TotpMfaVerifyForm'
|
|
14
13
|
|
|
15
14
|
import './style.less'
|
|
16
15
|
|
|
@@ -38,38 +37,24 @@ export const AppMfaLayout: FC<MfaLayoutProps> = () => {
|
|
|
38
37
|
onFail,
|
|
39
38
|
}
|
|
40
39
|
|
|
41
|
-
const formMap
|
|
40
|
+
const formMap = {
|
|
42
41
|
[ApplicationMfaType.EMAIL]: <EmailMfaVerifyForm {...formProps} />,
|
|
43
42
|
[ApplicationMfaType.SMS]: <SmsMfaVerifyForm {...formProps} />,
|
|
44
|
-
[ApplicationMfaType.OTP]: <TotpMfaVerifyForm {...formProps} />,
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onClick() {
|
|
61
|
-
setType(item.mfaPolicy)
|
|
62
|
-
},
|
|
63
|
-
}))
|
|
64
|
-
}, [mfaData, type])
|
|
65
|
-
|
|
66
|
-
// 根据配置动态确定 mfa 模块
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
// 取出第一个模块 作为默认值
|
|
69
|
-
if (mfaData.applicationMfa && mfaData.applicationMfa.length > 0) {
|
|
70
|
-
setType(mfaData.applicationMfa[0].mfaPolicy)
|
|
71
|
-
}
|
|
72
|
-
}, [mfaData])
|
|
45
|
+
const availableMfaType = mfaData.applicationMfa
|
|
46
|
+
?.filter(
|
|
47
|
+
(item) =>
|
|
48
|
+
item.status && Object.keys(ApplicationMfaType).includes(item.mfaPolicy)
|
|
49
|
+
)
|
|
50
|
+
?.sort((a, b) => a.sort - b.sort)
|
|
51
|
+
?.map((item) => ({
|
|
52
|
+
label: ApplicationMfaTypeLabel()[item.mfaPolicy],
|
|
53
|
+
key: item.mfaPolicy,
|
|
54
|
+
onClick() {
|
|
55
|
+
setType(item.mfaPolicy)
|
|
56
|
+
},
|
|
57
|
+
}))
|
|
73
58
|
|
|
74
59
|
return (
|
|
75
60
|
<div className="authing-text-center">
|
|
@@ -184,6 +184,8 @@ const useGuardConfig = () => {
|
|
|
184
184
|
? ''
|
|
185
185
|
: userConfig.title ?? appConfig.name ?? defaultGuardConfig.title
|
|
186
186
|
|
|
187
|
+
const description = loading ? '' : appConfig.description ?? ''
|
|
188
|
+
|
|
187
189
|
// 应用 logo
|
|
188
190
|
const logo = loading
|
|
189
191
|
? ''
|
|
@@ -218,6 +220,7 @@ const useGuardConfig = () => {
|
|
|
218
220
|
{
|
|
219
221
|
logo,
|
|
220
222
|
title,
|
|
223
|
+
description,
|
|
221
224
|
autoRegister,
|
|
222
225
|
loginMethods,
|
|
223
226
|
passwordLoginMethods,
|
|
@@ -232,7 +235,6 @@ const useGuardConfig = () => {
|
|
|
232
235
|
publicKey: appConfig.publicKey,
|
|
233
236
|
agreementEnabled: appConfig.agreementEnabled,
|
|
234
237
|
agreements: appConfig.agreements,
|
|
235
|
-
cdnBase: appConfig.cdnBase,
|
|
236
238
|
}
|
|
237
239
|
)
|
|
238
240
|
}, [
|
|
@@ -250,7 +252,6 @@ const useGuardConfig = () => {
|
|
|
250
252
|
appConfig.publicKey,
|
|
251
253
|
appConfig.agreementEnabled,
|
|
252
254
|
appConfig.agreements,
|
|
253
|
-
appConfig.cdnBase,
|
|
254
255
|
appConfig.socialConnections,
|
|
255
256
|
appConfig.identityProviders,
|
|
256
257
|
loading,
|
|
@@ -312,16 +313,7 @@ export const GuardLayout: FC<{
|
|
|
312
313
|
}) => {
|
|
313
314
|
const { t } = useTranslation()
|
|
314
315
|
const {
|
|
315
|
-
state: {
|
|
316
|
-
guardScenes,
|
|
317
|
-
authClient,
|
|
318
|
-
guardEvents,
|
|
319
|
-
activeTabs,
|
|
320
|
-
localesConfig,
|
|
321
|
-
guardSize,
|
|
322
|
-
showHeader,
|
|
323
|
-
showBottom,
|
|
324
|
-
},
|
|
316
|
+
state: { guardScenes, authClient, guardEvents, activeTabs, localesConfig },
|
|
325
317
|
setValue,
|
|
326
318
|
} = useGuardContext()
|
|
327
319
|
|
|
@@ -329,17 +321,6 @@ export const GuardLayout: FC<{
|
|
|
329
321
|
|
|
330
322
|
const { loading, errorMsg, guardConfig, errorDetail } = useGuardConfig()
|
|
331
323
|
|
|
332
|
-
const guardSizeClassName = useMemo(() => {
|
|
333
|
-
switch (guardSize) {
|
|
334
|
-
case 'large':
|
|
335
|
-
return 'authing-guard-size_large'
|
|
336
|
-
|
|
337
|
-
case 'middle':
|
|
338
|
-
case 'small':
|
|
339
|
-
return 'authing-guard-size'
|
|
340
|
-
}
|
|
341
|
-
}, [guardSize])
|
|
342
|
-
|
|
343
324
|
useEffect(() => {
|
|
344
325
|
if (lang) {
|
|
345
326
|
authClient.setLang(lang)
|
|
@@ -430,8 +411,8 @@ export const GuardLayout: FC<{
|
|
|
430
411
|
[GuardScenes.Login]: <LoginLayout />,
|
|
431
412
|
[GuardScenes.Register]: <RegisterLayout />,
|
|
432
413
|
[GuardScenes.RestPassword]: <ResetPwdLayout />,
|
|
433
|
-
[GuardScenes.CompleteUserInfo]: <CompleteUserInfoLayout />,
|
|
434
414
|
[GuardScenes.MfaVerify]: <MfaLayout />,
|
|
415
|
+
[GuardScenes.CompleteUserInfo]: <CompleteUserInfoLayout />,
|
|
435
416
|
[GuardScenes.AppMfaVerify]: <AppMfaLayout />,
|
|
436
417
|
}
|
|
437
418
|
|
|
@@ -468,7 +449,6 @@ export const GuardLayout: FC<{
|
|
|
468
449
|
className={getClassnames([
|
|
469
450
|
'authing-guard-container',
|
|
470
451
|
!realVisible && 'authing-guard-container__hidden',
|
|
471
|
-
guardSizeClassName,
|
|
472
452
|
])}
|
|
473
453
|
>
|
|
474
454
|
{isModal && guardConfig.clickCloseable && (
|
|
@@ -477,7 +457,7 @@ export const GuardLayout: FC<{
|
|
|
477
457
|
</button>
|
|
478
458
|
)}
|
|
479
459
|
|
|
480
|
-
|
|
460
|
+
<GuardHeader />
|
|
481
461
|
|
|
482
462
|
{loading ? (
|
|
483
463
|
<Spin size="large" className="authing-guard-loading" />
|
|
@@ -486,12 +466,10 @@ export const GuardLayout: FC<{
|
|
|
486
466
|
) : (
|
|
487
467
|
layoutMap[guardScenes]
|
|
488
468
|
)}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
<
|
|
492
|
-
|
|
493
|
-
</div>
|
|
494
|
-
)}
|
|
469
|
+
{/* <div>{localesConfig?.isShowChange && <ToggleLang />}</div> */}
|
|
470
|
+
<div>
|
|
471
|
+
{localesConfig?.isShowChange === false ? null : <ToggleLang />}
|
|
472
|
+
</div>
|
|
495
473
|
</div>
|
|
496
474
|
</>
|
|
497
475
|
</div>
|
|
@@ -10,7 +10,7 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
|
10
10
|
export const GuardHeader: FC<HeaderProps> = (props) => {
|
|
11
11
|
const {
|
|
12
12
|
state: {
|
|
13
|
-
config: { logo, title },
|
|
13
|
+
config: { logo, title, description },
|
|
14
14
|
},
|
|
15
15
|
} = useGuardContext()
|
|
16
16
|
|
|
@@ -19,7 +19,10 @@ export const GuardHeader: FC<HeaderProps> = (props) => {
|
|
|
19
19
|
{Boolean(logo) && (
|
|
20
20
|
<Avatar className="authing-guard-logo" src={logo} size={50}></Avatar>
|
|
21
21
|
)}
|
|
22
|
-
<div className="authing-guard-title">
|
|
22
|
+
<div className="authing-guard-title-container">
|
|
23
|
+
<div className="authing-guard-title">{title}</div>
|
|
24
|
+
<div className="authing-guard-description">{description}</div>
|
|
25
|
+
</div>
|
|
23
26
|
</div>
|
|
24
27
|
)
|
|
25
28
|
}
|
|
@@ -13,23 +13,26 @@
|
|
|
13
13
|
object-fit: contain;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.authing-guard-title-container {
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
16
23
|
.authing-guard-title {
|
|
17
|
-
color: #
|
|
24
|
+
color: #282d3c;
|
|
18
25
|
font-size: 24px;
|
|
19
|
-
margin-bottom:
|
|
26
|
+
margin-bottom: 4px;
|
|
20
27
|
width: 100%;
|
|
21
28
|
word-break: break-all;
|
|
22
29
|
text-align: center;
|
|
23
30
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// .large .title {
|
|
30
|
-
// color: #333333;
|
|
31
|
-
// font-size: 32px;
|
|
32
|
-
// }
|
|
31
|
+
.authing-guard-description {
|
|
32
|
+
font-size: 16px;
|
|
33
|
+
color: #878a95;
|
|
34
|
+
margin-bottom: 23px;
|
|
35
|
+
}
|
|
33
36
|
|
|
34
37
|
@media only screen and (max-width: 719px) {
|
|
35
38
|
.authing-guard-header {
|
|
@@ -45,8 +48,17 @@
|
|
|
45
48
|
padding-left: 8px;
|
|
46
49
|
color: #333333;
|
|
47
50
|
font-weight: 500;
|
|
51
|
+
text-align: unset;
|
|
48
52
|
}
|
|
49
53
|
.authing-guard-logo {
|
|
50
54
|
margin: 0;
|
|
51
55
|
}
|
|
56
|
+
.authing-guard-title-container {
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
align-items: flex-start;
|
|
59
|
+
}
|
|
60
|
+
.authing-guard-description {
|
|
61
|
+
margin-bottom: 0px;
|
|
62
|
+
padding-left: 8px;
|
|
63
|
+
}
|
|
52
64
|
}
|