@authing/react-ui-components 3.0.0-alpha → 3.0.0-rc.3
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/lib/index.d.ts +781 -110
- package/lib/index.min.css +2 -2
- package/lib/index.min.js +1 -1
- package/lib/index.min.js.LICENSE.txt +2 -0
- package/package.json +34 -12
- package/.eslintignore +0 -6
- package/.eslintrc.js +0 -7
- package/.prettierrc +0 -5
- package/.vscode/settings.json +0 -31
- package/build/favicon.ico +0 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +0 -25
- package/build/robots.txt +0 -3
- package/components/AuthingDropdown/index.tsx +0 -52
- package/components/AuthingDropdown/style.less +0 -43
- package/components/AuthingGuard/AppMFALayout/index.tsx +0 -74
- package/components/AuthingGuard/AppMFALayout/style.less +0 -12
- package/components/AuthingGuard/CompleteUserInfoLayout/index.tsx +0 -29
- package/components/AuthingGuard/CompleteUserInfoLayout/style.less +0 -8
- package/components/AuthingGuard/Forms/ADLoginForm/index.tsx +0 -117
- package/components/AuthingGuard/Forms/Agreements/index.tsx +0 -81
- package/components/AuthingGuard/Forms/Agreements/style.less +0 -44
- package/components/AuthingGuard/Forms/CompleteUserInfoForm/index.tsx +0 -139
- package/components/AuthingGuard/Forms/EmailMfaVerifyForm/CheckEmailForm.tsx +0 -84
- package/components/AuthingGuard/Forms/EmailMfaVerifyForm/VerifyCodeForm.tsx +0 -116
- package/components/AuthingGuard/Forms/EmailMfaVerifyForm/index.tsx +0 -40
- package/components/AuthingGuard/Forms/EmailMfaVerifyForm/style.less +0 -0
- package/components/AuthingGuard/Forms/EmailRegisterForm/index.tsx +0 -181
- package/components/AuthingGuard/Forms/EmailRegisterForm/style.less +0 -0
- package/components/AuthingGuard/Forms/LdapLoginForm/index.tsx +0 -166
- package/components/AuthingGuard/Forms/LdapLoginForm/style.less +0 -0
- package/components/AuthingGuard/Forms/LoginFormFooter/index.tsx +0 -76
- package/components/AuthingGuard/Forms/LoginFormFooter/style.less +0 -6
- package/components/AuthingGuard/Forms/MfaResetCodeForm/Step1.tsx +0 -86
- package/components/AuthingGuard/Forms/MfaResetCodeForm/Step2.tsx +0 -53
- package/components/AuthingGuard/Forms/MfaResetCodeForm/index.tsx +0 -65
- package/components/AuthingGuard/Forms/MfaResetCodeForm/style.less +0 -20
- package/components/AuthingGuard/Forms/MfaVerifyForm/index.tsx +0 -105
- package/components/AuthingGuard/Forms/MfaVerifyForm/style.less +0 -12
- package/components/AuthingGuard/Forms/PasswordLoginForm/index.tsx +0 -261
- package/components/AuthingGuard/Forms/PhoneCodeLoginForm/index.tsx +0 -133
- package/components/AuthingGuard/Forms/PhoneRegisterForm/index.tsx +0 -202
- package/components/AuthingGuard/Forms/QrCodeLoginForm/index.tsx +0 -59
- package/components/AuthingGuard/Forms/QrCodeLoginForm/style.less +0 -14
- package/components/AuthingGuard/Forms/RegisterFormFooter/index.tsx +0 -56
- package/components/AuthingGuard/Forms/RegisterFormFooter/style.less +0 -0
- package/components/AuthingGuard/Forms/ResetPwdForm/Footer.tsx +0 -21
- package/components/AuthingGuard/Forms/ResetPwdForm/Step1.tsx +0 -86
- package/components/AuthingGuard/Forms/ResetPwdForm/Step2.tsx +0 -127
- package/components/AuthingGuard/Forms/ResetPwdForm/Step3.tsx +0 -141
- package/components/AuthingGuard/Forms/ResetPwdForm/Step4.tsx +0 -51
- package/components/AuthingGuard/Forms/ResetPwdForm/index.tsx +0 -96
- package/components/AuthingGuard/Forms/ResetPwdForm/style.less +0 -3
- package/components/AuthingGuard/Forms/SendPhoneCode/SendCodeBtn.tsx +0 -88
- package/components/AuthingGuard/Forms/SendPhoneCode/index.tsx +0 -50
- package/components/AuthingGuard/Forms/SendPhoneCode/style.less +0 -26
- package/components/AuthingGuard/Forms/SmsMfaVerifyForm/CheckPhoneForm.tsx +0 -86
- package/components/AuthingGuard/Forms/SmsMfaVerifyForm/VerifyCodeForm.tsx +0 -113
- package/components/AuthingGuard/Forms/SmsMfaVerifyForm/index.tsx +0 -40
- package/components/AuthingGuard/Forms/SmsMfaVerifyForm/style.less +0 -3
- package/components/AuthingGuard/Forms/SocialAndIdpLogin/index.tsx +0 -325
- package/components/AuthingGuard/Forms/SocialAndIdpLogin/style.less +0 -75
- package/components/AuthingGuard/Forms/UploadImage/index.tsx +0 -70
- package/components/AuthingGuard/Forms/index.ts +0 -13
- package/components/AuthingGuard/GuardLayout/index.tsx +0 -474
- package/components/AuthingGuard/GuardLayout/style.less +0 -111
- package/components/AuthingGuard/Header/index.tsx +0 -25
- package/components/AuthingGuard/Header/style.less +0 -52
- package/components/AuthingGuard/IconFont/iconfont.js +0 -74
- package/components/AuthingGuard/IconFont/index.tsx +0 -19
- package/components/AuthingGuard/IconFont/style.less +0 -6
- package/components/AuthingGuard/IconFont/svg.js +0 -2
- package/components/AuthingGuard/LoginLayout/index.tsx +0 -161
- package/components/AuthingGuard/LoginLayout/style.less +0 -0
- package/components/AuthingGuard/MfaLayout/Steps.ts +0 -4
- package/components/AuthingGuard/MfaLayout/index.tsx +0 -49
- package/components/AuthingGuard/MfaLayout/style.less +0 -3
- package/components/AuthingGuard/RegisterLayout/index.tsx +0 -89
- package/components/AuthingGuard/RegisterLayout/style.less +0 -0
- package/components/AuthingGuard/ResetPwdLayout/index.tsx +0 -20
- package/components/AuthingGuard/ToggleLang/index.tsx +0 -51
- package/components/AuthingGuard/api/appConfig.ts +0 -146
- package/components/AuthingGuard/api/index.ts +0 -3
- package/components/AuthingGuard/api/sso.ts +0 -29
- package/components/AuthingGuard/api/userPoolConfig.ts +0 -111
- package/components/AuthingGuard/constants.ts +0 -105
- package/components/AuthingGuard/hooks/index.tsx +0 -70
- package/components/AuthingGuard/hooks/useScreenSize.tsx +0 -68
- package/components/AuthingGuard/index.tsx +0 -126
- package/components/AuthingGuard/style.less +0 -103
- package/components/AuthingGuard/types/Forms.ts +0 -94
- package/components/AuthingGuard/types/GuardConfig.ts +0 -420
- package/components/AuthingGuard/types/GuardState.ts +0 -7
- package/components/AuthingGuard/types/Locales.ts +0 -12
- package/components/AuthingGuard/types/index.ts +0 -4
- package/components/AuthingTabs/index.tsx +0 -98
- package/components/AuthingTabs/style.less +0 -135
- package/components/BindTotp/core/bindSuccess.tsx +0 -61
- package/components/BindTotp/core/securityCode.tsx +0 -119
- package/components/BindTotp/index.tsx +0 -134
- package/components/BindTotp/props.ts +0 -30
- package/components/BindTotp/styles.less +0 -56
- package/components/ChangeLanguage/index.tsx +0 -35
- package/components/ChangePassword/core/firstLoginReset.tsx +0 -104
- package/components/ChangePassword/core/rotateReset.tsx +0 -114
- package/components/ChangePassword/index.tsx +0 -59
- package/components/CompleteInfo/core/completeInfo.tsx +0 -155
- package/components/CompleteInfo/index.tsx +0 -45
- package/components/CompleteInfo/props.ts +0 -40
- package/components/CompleteInfo/styles.less +0 -7
- package/components/CompleteUserInfo/index.tsx +0 -49
- package/components/CompleteUserInfo/props.ts +0 -25
- package/components/ComponentsRender/index.back +0 -64
- package/components/CopyAbleText/index.tsx +0 -54
- package/components/CopyAbleText/style.less +0 -13
- package/components/DownloadAuthenticator/index.tsx +0 -97
- package/components/DownloadAuthenticator/props.ts +0 -22
- package/components/DownloadAuthenticator/styles.less +0 -52
- package/components/ForgetPassword/core/resetPassword.tsx +0 -150
- package/components/ForgetPassword/index.tsx +0 -51
- package/components/Guard/Guard.tsx +0 -226
- package/components/Guard/authClient.ts +0 -55
- package/components/Guard/config.ts +0 -19
- package/components/Guard/event.ts +0 -18
- package/components/Guard/index.tsx +0 -10
- package/components/Guard/module.ts +0 -19
- package/components/Guard/stateMachine.ts +0 -133
- package/components/Guard/styles.less +0 -444
- package/components/IconFont/iconfont.js +0 -74
- package/components/IconFont/index.tsx +0 -16
- package/components/IconFont/style.less +0 -6
- package/components/IconFont/svg.js +0 -2
- package/components/ImagePro/index.tsx +0 -52
- package/components/ImagePro/styles.less +0 -40
- package/components/Login/codemap.ts +0 -35
- package/components/Login/core/withAD.tsx +0 -9
- package/components/Login/core/withAppQrcode.tsx +0 -49
- package/components/Login/core/withLDAP.tsx +0 -145
- package/components/Login/core/withPassword.tsx +0 -176
- package/components/Login/core/withPhonecode.tsx +0 -135
- package/components/Login/core/withWechatMiniQrcode.tsx +0 -60
- package/components/Login/core/withWechatmpQrcode.tsx +0 -53
- package/components/Login/index.tsx +0 -359
- package/components/Login/props.ts +0 -90
- package/components/Login/socialLogin/index.tsx +0 -413
- package/components/Login/socialLogin/style.less +0 -61
- package/components/Login/styles.less +0 -53
- package/components/MFA/codemap.ts +0 -21
- package/components/MFA/core/email.tsx +0 -226
- package/components/MFA/core/face.tsx +0 -297
- package/components/MFA/core/face_deps.tsx +0 -37
- package/components/MFA/core/sms.tsx +0 -222
- package/components/MFA/core/totp.tsx +0 -137
- package/components/MFA/index.tsx +0 -135
- package/components/MFA/mfaMethods/index.tsx +0 -81
- package/components/MFA/mfaMethods/style.less +0 -39
- package/components/MFA/props.ts +0 -51
- package/components/MFA/styles.less +0 -92
- package/components/NeedHelpView/core/describeQuestions.tsx +0 -227
- package/components/NeedHelpView/index.tsx +0 -99
- package/components/RecoveryCode/core/useCode.tsx +0 -71
- package/components/RecoveryCode/index.tsx +0 -27
- package/components/RecoveryCode/interface.ts +0 -31
- package/components/RecoveryCode/style.less +0 -13
- package/components/Register/codemap.ts +0 -16
- package/components/Register/components/Agreements/index.tsx +0 -81
- package/components/Register/components/Agreements/style.less +0 -44
- package/components/Register/core/WithEmail.tsx +0 -250
- package/components/Register/core/WithPhone.tsx +0 -190
- package/components/Register/index.tsx +0 -122
- package/components/Register/props.ts +0 -50
- package/components/SendCode/SendCodeBtn.tsx +0 -96
- package/components/SendCode/index.tsx +0 -98
- package/components/SendCode/style.less +0 -31
- package/components/ShieldSpin/index.tsx +0 -27
- package/components/ShieldSpin/loading.svg +0 -29
- package/components/SubmitButton/index.tsx +0 -50
- package/components/Type/index.ts +0 -61
- package/components/VerifyCodeInput/index.tsx +0 -76
- package/components/VerifyCodeInput/style.less +0 -24
- package/components/_utils/GuardErrorCode.ts +0 -8
- package/components/_utils/clipboard.ts +0 -27
- package/components/_utils/config.ts +0 -123
- package/components/_utils/guradHttp.ts +0 -93
- package/components/_utils/hooks/index.ts +0 -56
- package/components/_utils/http.ts +0 -85
- package/components/_utils/index.ts +0 -310
- package/components/_utils/locales/en/common.json +0 -218
- package/components/_utils/locales/en/index.ts +0 -6
- package/components/_utils/locales/en/login.json +0 -95
- package/components/_utils/locales/en/map.json +0 -4
- package/components/_utils/locales/en/user.json +0 -82
- package/components/_utils/locales/index.ts +0 -45
- package/components/_utils/locales/zh/common.json +0 -218
- package/components/_utils/locales/zh/index.ts +0 -6
- package/components/_utils/locales/zh/login.json +0 -95
- package/components/_utils/locales/zh/map.json +0 -4
- package/components/_utils/locales/zh/user.json +0 -82
- package/components/_utils/popupCenter.ts +0 -48
- package/components/context/base.tsx +0 -28
- package/components/context/global/context.tsx +0 -39
- package/components/context/global/reducer.tsx +0 -56
- package/components/context/module/context.tsx +0 -23
- package/components/index.ts +0 -10
- package/config/antdReplacer.js +0 -51
- package/config/env.js +0 -104
- package/config/getHttpsConfig.js +0 -66
- package/config/jest/cssTransform.js +0 -14
- package/config/jest/fileTransform.js +0 -40
- package/config/modules.js +0 -134
- package/config/paths.js +0 -71
- package/config/pnpTs.js +0 -35
- package/config/webpack.config.js +0 -835
- package/config/webpackDevServer.config.js +0 -130
- package/examples.tsx +0 -100
- package/index.js +0 -1
- package/logo.svg +0 -7
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/react-app-env.d.ts +0 -71
- package/reportWebVitals.ts +0 -15
- package/scripts/build.js +0 -208
- package/scripts/lib.js +0 -200
- package/scripts/start.js +0 -162
- package/scripts/test.js +0 -49
- package/setupTests.ts +0 -5
- package/tsconfig.json +0 -30
|
@@ -67,3 +67,5 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
67
67
|
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
68
68
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
69
69
|
*/
|
|
70
|
+
|
|
71
|
+
//! moment.js
|
package/package.json
CHANGED
|
@@ -1,28 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authing/react-ui-components",
|
|
3
|
-
"version": "3.0.0-
|
|
4
|
-
"framework": "React",
|
|
3
|
+
"version": "3.0.0-rc.3",
|
|
5
4
|
"private": false,
|
|
6
5
|
"main": "lib/index.min.js",
|
|
7
6
|
"typings": "lib/index.d.ts",
|
|
7
|
+
"types": "react-app-env.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"lib"
|
|
11
|
+
],
|
|
8
12
|
"dependencies": {
|
|
9
13
|
"antd": "^4.8.0",
|
|
10
|
-
"authing-js-sdk": "4.22.18",
|
|
14
|
+
"authing-js-sdk": "4.22.26-alpha.18",
|
|
11
15
|
"face-api.js": "^0.22.2",
|
|
16
|
+
"fastclick": "^1.0.6",
|
|
12
17
|
"global": "^4.4.0",
|
|
13
18
|
"qs": "^6.9.4",
|
|
14
19
|
"react-use": "^17.3.1"
|
|
15
20
|
},
|
|
16
|
-
"types": "react-app-env.d.ts",
|
|
17
21
|
"peerDependencies": {
|
|
18
|
-
"react": "16.
|
|
19
|
-
"react-dom": "16.
|
|
22
|
+
"react": ">=16.9.0",
|
|
23
|
+
"react-dom": ">=16.9.0"
|
|
20
24
|
},
|
|
21
25
|
"scripts": {
|
|
22
|
-
"
|
|
23
|
-
"build": "node scripts/
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
+
"build": "node ./scripts/build.js",
|
|
27
|
+
"build:lib": "node ./scripts/lib.js",
|
|
28
|
+
"clear": "clear:lib && clear:dist",
|
|
29
|
+
"clear:dist": "rm -rf dist",
|
|
30
|
+
"clear:lib": "rm -rf lib",
|
|
31
|
+
"log-tag": "node ./scripts/tag.js",
|
|
32
|
+
"pretty-quick": "pretty-quick",
|
|
33
|
+
"prestart": "npm run log-tag && npm run version",
|
|
34
|
+
"prebuild:lib": "npm run log-tag && npm run version",
|
|
35
|
+
"prepare": "cd ../.. && husky install packages/react-components/.husky",
|
|
36
|
+
"pub": "npm run build:lib && node ./scripts/publish.js",
|
|
37
|
+
"start": "PORT=3006 node ./scripts/start.js",
|
|
38
|
+
"vite": "vite",
|
|
39
|
+
"version": "node ./scripts/generate-version"
|
|
26
40
|
},
|
|
27
41
|
"publishConfig": {
|
|
28
42
|
"access": "public",
|
|
@@ -120,6 +134,7 @@
|
|
|
120
134
|
"@types/shortid": "^0.0.29",
|
|
121
135
|
"@typescript-eslint/eslint-plugin": "^4.5.0",
|
|
122
136
|
"@typescript-eslint/parser": "^4.5.0",
|
|
137
|
+
"@vitejs/plugin-react": "1.1.0",
|
|
123
138
|
"babel-eslint": "^10.1.0",
|
|
124
139
|
"babel-jest": "^26.6.0",
|
|
125
140
|
"babel-loader": "8.1.0",
|
|
@@ -129,6 +144,8 @@
|
|
|
129
144
|
"bfj": "^7.0.2",
|
|
130
145
|
"camelcase": "^6.1.0",
|
|
131
146
|
"case-sensitive-paths-webpack-plugin": "2.3.0",
|
|
147
|
+
"chalk": "^4.1.2",
|
|
148
|
+
"cross-env": "^7.0.3",
|
|
132
149
|
"css-loader": "4.3.0",
|
|
133
150
|
"dotenv": "8.2.0",
|
|
134
151
|
"dotenv-expand": "5.1.0",
|
|
@@ -147,6 +164,7 @@
|
|
|
147
164
|
"file-loader": "6.1.1",
|
|
148
165
|
"fs-extra": "^9.0.1",
|
|
149
166
|
"html-webpack-plugin": "4.5.0",
|
|
167
|
+
"husky": "^7.0.4",
|
|
150
168
|
"i18next": "^20.1.0",
|
|
151
169
|
"i18next-browser-languagedetector": "^6.1.0",
|
|
152
170
|
"identity-obj-proxy": "3.0.0",
|
|
@@ -167,6 +185,7 @@
|
|
|
167
185
|
"postcss-rename-selector": "^0.1.1",
|
|
168
186
|
"postcss-safe-parser": "5.0.2",
|
|
169
187
|
"prettier": "^2.1.2",
|
|
188
|
+
"pretty-quick": "^3.0.0",
|
|
170
189
|
"query-string": "^7.0.0",
|
|
171
190
|
"react": "16.14.0",
|
|
172
191
|
"react-app-polyfill": "^2.0.0",
|
|
@@ -178,17 +197,20 @@
|
|
|
178
197
|
"resolve-url-loader": "^3.1.2",
|
|
179
198
|
"sass-loader": "8.0.2",
|
|
180
199
|
"semver": "7.3.2",
|
|
200
|
+
"shelljs": "^0.8.4",
|
|
181
201
|
"shortid": "^2.2.16",
|
|
182
202
|
"style-loader": "1.3.0",
|
|
183
203
|
"terser-webpack-plugin": "4.2.3",
|
|
184
204
|
"ts-pnp": "1.2.0",
|
|
185
205
|
"typescript": "^4.0.3",
|
|
186
206
|
"url-loader": "4.1.1",
|
|
207
|
+
"vite": "^2.6.14",
|
|
187
208
|
"web-vitals": "^0.2.4",
|
|
188
209
|
"webpack": "4.44.2",
|
|
189
210
|
"webpack-bundle-analyzer": "^4.1.0",
|
|
190
211
|
"webpack-dev-server": "3.11.0",
|
|
191
212
|
"webpack-manifest-plugin": "2.2.0",
|
|
192
213
|
"workbox-webpack-plugin": "5.1.4"
|
|
193
|
-
}
|
|
194
|
-
|
|
214
|
+
},
|
|
215
|
+
"gitHead": "a7ef72250a4192b1b11f4fe9ab81d2566e036e46"
|
|
216
|
+
}
|
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED
package/.prettierrc
DELETED
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
|
-
}
|
package/build/favicon.ico
DELETED
|
Binary file
|
package/build/logo192.png
DELETED
|
Binary file
|
package/build/logo512.png
DELETED
|
Binary file
|
package/build/manifest.json
DELETED
|
@@ -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,52 +0,0 @@
|
|
|
1
|
-
import { DownOutlined } from '@ant-design/icons'
|
|
2
|
-
import React, { FC, useState } from 'react'
|
|
3
|
-
import { getClassnames } from '../_utils'
|
|
4
|
-
|
|
5
|
-
import './style.less'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* 不使用 antd 的 dropdown,因为里面会用 tooltip,体积过大
|
|
9
|
-
*/
|
|
10
|
-
export const AuthingDropdown: FC<{
|
|
11
|
-
className?: string
|
|
12
|
-
menus: {
|
|
13
|
-
label: React.ReactNode
|
|
14
|
-
key: string | number
|
|
15
|
-
onClick?: (
|
|
16
|
-
key: string | number,
|
|
17
|
-
evt: React.MouseEvent<HTMLDivElement, MouseEvent>
|
|
18
|
-
) => void
|
|
19
|
-
}[]
|
|
20
|
-
}> = ({ menus, children, className }) => {
|
|
21
|
-
const [visible, setVisible] = useState(false)
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div
|
|
25
|
-
className={getClassnames(['authing-dropdown', className])}
|
|
26
|
-
onMouseEnter={() => setVisible(true)}
|
|
27
|
-
onMouseLeave={() => setVisible(false)}
|
|
28
|
-
>
|
|
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
|
-
))}
|
|
48
|
-
</div>
|
|
49
|
-
<DownOutlined className="authing-dropdown-icon" />
|
|
50
|
-
</div>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
.authing-dropdown {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
position: relative;
|
|
4
|
-
align-items: center;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.authing-dropdown-trigger {
|
|
8
|
-
cursor: pointer;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.authing-dropdown-menu-container {
|
|
12
|
-
height: 0;
|
|
13
|
-
opacity: 0;
|
|
14
|
-
position: absolute;
|
|
15
|
-
top: 100%;
|
|
16
|
-
left: 0;
|
|
17
|
-
transition: all 0.3s;
|
|
18
|
-
cursor: pointer;
|
|
19
|
-
background-color: #fff;
|
|
20
|
-
padding: 4px 0;
|
|
21
|
-
border-radius: 2px;
|
|
22
|
-
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
23
|
-
0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
24
|
-
pointer-events: none;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.authing-dropdown-menu-container__visible {
|
|
28
|
-
height: auto;
|
|
29
|
-
opacity: 1;
|
|
30
|
-
pointer-events: unset;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.authing-dropdown-menu-item {
|
|
34
|
-
padding: 5px 12px;
|
|
35
|
-
transition: all 0.3s;
|
|
36
|
-
&:hover {
|
|
37
|
-
background-color: #f5f5f5;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.authing-dropdown-icon {
|
|
42
|
-
margin-left: 8px;
|
|
43
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { message } from 'antd'
|
|
2
|
-
import { User } from 'authing-js-sdk'
|
|
3
|
-
import React, { FC, useState } from 'react'
|
|
4
|
-
import { useTranslation } from 'react-i18next'
|
|
5
|
-
import { AuthingDropdown } from '../../AuthingDropdown'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
EmailMfaVerifyForm,
|
|
9
|
-
SmsMfaVerifyForm,
|
|
10
|
-
} from '../../../components/AuthingGuard/Forms'
|
|
11
|
-
import { useGuardContext } from '../../context/global/context'
|
|
12
|
-
import { ApplicationMfaType, ApplicationMfaTypeLabel } from '../api'
|
|
13
|
-
|
|
14
|
-
import './style.less'
|
|
15
|
-
|
|
16
|
-
export interface MfaLayoutProps {}
|
|
17
|
-
|
|
18
|
-
export const AppMfaLayout: FC<MfaLayoutProps> = () => {
|
|
19
|
-
const { t } = useTranslation()
|
|
20
|
-
const {
|
|
21
|
-
state: { guardEvents, authClient, mfaData },
|
|
22
|
-
} = useGuardContext()
|
|
23
|
-
|
|
24
|
-
const [type, setType] = useState(ApplicationMfaType.SMS)
|
|
25
|
-
|
|
26
|
-
const onSuccess = (user: User) => {
|
|
27
|
-
message.success(t('common.LoginSuccess'))
|
|
28
|
-
guardEvents.onLogin?.(user, authClient)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const onFail = (error: any) => {
|
|
32
|
-
guardEvents.onLoginError?.(error, authClient)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const formProps = {
|
|
36
|
-
onSuccess,
|
|
37
|
-
onFail,
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const formMap = {
|
|
41
|
-
[ApplicationMfaType.EMAIL]: <EmailMfaVerifyForm {...formProps} />,
|
|
42
|
-
[ApplicationMfaType.SMS]: <SmsMfaVerifyForm {...formProps} />,
|
|
43
|
-
}
|
|
44
|
-
|
|
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
|
-
}))
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<div className="authing-text-center">
|
|
61
|
-
{formMap[type]}
|
|
62
|
-
{(availableMfaType?.length || 0 > 1) && (
|
|
63
|
-
<AuthingDropdown
|
|
64
|
-
className="toggle-mfa-dropdown"
|
|
65
|
-
menus={availableMfaType!}
|
|
66
|
-
>
|
|
67
|
-
<span className="authing-toggle-mfa">
|
|
68
|
-
{t('login.otherVerifyWay')}
|
|
69
|
-
</span>
|
|
70
|
-
</AuthingDropdown>
|
|
71
|
-
)}
|
|
72
|
-
</div>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react'
|
|
2
|
-
import { useTranslation } from 'react-i18next'
|
|
3
|
-
import { useGuardContext } from '../../context/global/context'
|
|
4
|
-
import { CompleteUserInfoForm } from '../Forms/CompleteUserInfoForm'
|
|
5
|
-
|
|
6
|
-
import './style.less'
|
|
7
|
-
|
|
8
|
-
export const CompleteUserInfoLayout: FC = () => {
|
|
9
|
-
const {
|
|
10
|
-
state: { guardTitle },
|
|
11
|
-
} = useGuardContext()
|
|
12
|
-
|
|
13
|
-
const { t } = useTranslation()
|
|
14
|
-
return (
|
|
15
|
-
<div>
|
|
16
|
-
<h2 className="authing-guard-complete-info-title">
|
|
17
|
-
{t('common.perfectUserInfo')}
|
|
18
|
-
</h2>
|
|
19
|
-
|
|
20
|
-
<p className="authing-guard-complete-info-msg">
|
|
21
|
-
{t('common.welcomeDoc', {
|
|
22
|
-
name: guardTitle,
|
|
23
|
-
})}
|
|
24
|
-
</p>
|
|
25
|
-
|
|
26
|
-
<CompleteUserInfoForm />
|
|
27
|
-
</div>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { Input, Form, message } from 'antd'
|
|
2
|
-
import { FormInstance } from 'antd/lib/form'
|
|
3
|
-
import { UserOutlined, LockOutlined } from '@ant-design/icons'
|
|
4
|
-
import React, { forwardRef, useImperativeHandle, useState } from 'react'
|
|
5
|
-
|
|
6
|
-
import { useGuardContext } from '../../../context/global/context'
|
|
7
|
-
import {
|
|
8
|
-
ADLoginFormProps,
|
|
9
|
-
LoginMethods,
|
|
10
|
-
} from '../../../../components/AuthingGuard/types'
|
|
11
|
-
import { LoginFormFooter } from '../../../../components/AuthingGuard/Forms/LoginFormFooter'
|
|
12
|
-
import { useTranslation } from 'react-i18next'
|
|
13
|
-
import { getRequiredRules } from '../../../_utils'
|
|
14
|
-
|
|
15
|
-
export const ADLoginForm = forwardRef<FormInstance, ADLoginFormProps>(
|
|
16
|
-
({ onSuccess, onValidateFail, onFail }, ref) => {
|
|
17
|
-
const { t } = useTranslation()
|
|
18
|
-
const { state } = useGuardContext()
|
|
19
|
-
const { authClient, guardEvents } = state
|
|
20
|
-
|
|
21
|
-
const [loading, setLoading] = useState(false)
|
|
22
|
-
|
|
23
|
-
const onFinishFailed = (errorInfo: any) => {
|
|
24
|
-
setLoading(false)
|
|
25
|
-
onValidateFail && onValidateFail(errorInfo)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const [rawForm] = Form.useForm()
|
|
29
|
-
|
|
30
|
-
const onFinish = async (values: any) => {
|
|
31
|
-
if (guardEvents.onBeforeLogin) {
|
|
32
|
-
try {
|
|
33
|
-
const canLogin = await guardEvents.onBeforeLogin(
|
|
34
|
-
{
|
|
35
|
-
type: LoginMethods.AD,
|
|
36
|
-
data: {
|
|
37
|
-
identity: values.identity,
|
|
38
|
-
password: values.password,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
authClient
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
if (!canLogin) {
|
|
45
|
-
setLoading(false)
|
|
46
|
-
return
|
|
47
|
-
}
|
|
48
|
-
} catch (e) {
|
|
49
|
-
if (typeof e === 'string') {
|
|
50
|
-
message.error(e)
|
|
51
|
-
} else {
|
|
52
|
-
message.error(e.message)
|
|
53
|
-
}
|
|
54
|
-
setLoading(false)
|
|
55
|
-
return
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
const identity = values.identity && values.identity.trim()
|
|
61
|
-
const password = values.password && values.password.trim()
|
|
62
|
-
const user = await authClient.loginByAd(identity, password)
|
|
63
|
-
onSuccess && onSuccess(user)
|
|
64
|
-
} catch (error) {
|
|
65
|
-
if (typeof error.message === 'string') {
|
|
66
|
-
// js sdk httpclient 的报错,这里只有一种情况就是用户开启了 mfa 的报错
|
|
67
|
-
try {
|
|
68
|
-
const errorData = JSON.parse(error.message)
|
|
69
|
-
onFail && onFail(errorData)
|
|
70
|
-
return
|
|
71
|
-
} catch (_) {
|
|
72
|
-
// do nothing
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
onFail && onFail(error)
|
|
76
|
-
} finally {
|
|
77
|
-
setLoading(false)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
useImperativeHandle(ref, () => rawForm)
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<Form
|
|
85
|
-
form={rawForm}
|
|
86
|
-
onSubmitCapture={() => setLoading(true)}
|
|
87
|
-
onFinishFailed={onFinishFailed}
|
|
88
|
-
onFinish={onFinish}
|
|
89
|
-
>
|
|
90
|
-
<Form.Item
|
|
91
|
-
name="identity"
|
|
92
|
-
rules={getRequiredRules(t('login.inputAdUsername'))}
|
|
93
|
-
>
|
|
94
|
-
<Input
|
|
95
|
-
autoComplete="email,username,tel"
|
|
96
|
-
size="large"
|
|
97
|
-
placeholder={t('login.inputAdUsername')}
|
|
98
|
-
prefix={<UserOutlined style={{ color: '#ddd' }} />}
|
|
99
|
-
/>
|
|
100
|
-
</Form.Item>
|
|
101
|
-
<Form.Item
|
|
102
|
-
name="password"
|
|
103
|
-
rules={getRequiredRules(t('login.inputAdPwd'))}
|
|
104
|
-
>
|
|
105
|
-
<Input.Password
|
|
106
|
-
autoComplete="current-password"
|
|
107
|
-
size="large"
|
|
108
|
-
visibilityToggle={false}
|
|
109
|
-
placeholder={t('login.inputAdPwd')}
|
|
110
|
-
prefix={<LockOutlined style={{ color: '#ddd' }} />}
|
|
111
|
-
/>
|
|
112
|
-
</Form.Item>
|
|
113
|
-
<LoginFormFooter loading={loading}></LoginFormFooter>
|
|
114
|
-
</Form>
|
|
115
|
-
)
|
|
116
|
-
}
|
|
117
|
-
)
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import React, { FC, useState, useMemo, useEffect } from 'react'
|
|
2
|
-
import { Space, Checkbox } from 'antd'
|
|
3
|
-
import { Agreement } from '../../api'
|
|
4
|
-
import './style.less'
|
|
5
|
-
import { getClassnames } from '../../../_utils'
|
|
6
|
-
|
|
7
|
-
export interface AgreementsProps {
|
|
8
|
-
value?: boolean
|
|
9
|
-
onChange?: (value: boolean) => void
|
|
10
|
-
style?: React.CSSProperties
|
|
11
|
-
agreements: Agreement[]
|
|
12
|
-
showError?: boolean
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const Agreements: FC<AgreementsProps> = ({
|
|
16
|
-
showError,
|
|
17
|
-
onChange = () => {},
|
|
18
|
-
style,
|
|
19
|
-
agreements,
|
|
20
|
-
}) => {
|
|
21
|
-
const [acceptList, setAcceptList] = useState<(string | number)[]>([])
|
|
22
|
-
|
|
23
|
-
const toggleItemCheck = (id: string | number) => {
|
|
24
|
-
setAcceptList((prev) => {
|
|
25
|
-
if (prev.includes(id)) {
|
|
26
|
-
return prev.filter((item) => item !== id)
|
|
27
|
-
}
|
|
28
|
-
return [...prev, id]
|
|
29
|
-
})
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** 是否可以注册 */
|
|
33
|
-
const isAccept = useMemo(() => {
|
|
34
|
-
/** 所有必须勾选的都勾了就可以通过 */
|
|
35
|
-
return agreements
|
|
36
|
-
.filter((item) => item.required)
|
|
37
|
-
.every((item) => acceptList.includes(item.id))
|
|
38
|
-
}, [acceptList, agreements])
|
|
39
|
-
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
onChange(isAccept)
|
|
42
|
-
}, [isAccept, onChange])
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<div
|
|
46
|
-
className={getClassnames([
|
|
47
|
-
'authing-agreements',
|
|
48
|
-
showError && 'authing-agreements-error',
|
|
49
|
-
])}
|
|
50
|
-
>
|
|
51
|
-
{agreements.map((item) => {
|
|
52
|
-
return (
|
|
53
|
-
<div
|
|
54
|
-
key={item.id}
|
|
55
|
-
style={{ ...style }}
|
|
56
|
-
className={getClassnames([
|
|
57
|
-
'authing-agreements-item',
|
|
58
|
-
item.required &&
|
|
59
|
-
!acceptList.includes(item.id) &&
|
|
60
|
-
'authing-agreements-item-invalid',
|
|
61
|
-
])}
|
|
62
|
-
onClick={() => toggleItemCheck(item.id)}
|
|
63
|
-
>
|
|
64
|
-
<Space align="start" size={5}>
|
|
65
|
-
<Checkbox
|
|
66
|
-
className="authing-agreements-checkbox"
|
|
67
|
-
checked={acceptList.includes(item.id)}
|
|
68
|
-
/>
|
|
69
|
-
<div
|
|
70
|
-
className="authing-agreements-item-content"
|
|
71
|
-
dangerouslySetInnerHTML={{
|
|
72
|
-
__html: item.title,
|
|
73
|
-
}}
|
|
74
|
-
></div>
|
|
75
|
-
</Space>
|
|
76
|
-
</div>
|
|
77
|
-
)
|
|
78
|
-
})}
|
|
79
|
-
</div>
|
|
80
|
-
)
|
|
81
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
.authing-agreements {
|
|
2
|
-
margin-top: 20px;
|
|
3
|
-
margin-bottom: 20px;
|
|
4
|
-
&.authing-agreements-error {
|
|
5
|
-
.authing-agreements-item-invalid {
|
|
6
|
-
color: #ff4d4f;
|
|
7
|
-
a {
|
|
8
|
-
color: #ff4d4f;
|
|
9
|
-
}
|
|
10
|
-
:global(.ant-checkbox-inner) {
|
|
11
|
-
border-color: #ff4d4f;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.authing-agreements-item {
|
|
18
|
-
color: #999999;
|
|
19
|
-
user-select: none;
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
font-size: 12px;
|
|
22
|
-
&:not(:first-child) {
|
|
23
|
-
margin-top: 4px;
|
|
24
|
-
}
|
|
25
|
-
p {
|
|
26
|
-
margin-bottom: 0;
|
|
27
|
-
display: inline-block;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.authing-agreements-checkbox {
|
|
32
|
-
margin-bottom: 2px;
|
|
33
|
-
:global(.ant-checkbox-inner) {
|
|
34
|
-
width: 14px;
|
|
35
|
-
height: 14px;
|
|
36
|
-
&::after {
|
|
37
|
-
left: 20%;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.authing-agreements-item-content {
|
|
43
|
-
line-height: 23px;
|
|
44
|
-
}
|