@authing/react-ui-components 4.0.3-zhihu.1 → 4.0.4-alpha.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.
- package/lib/index.min.css +2 -2
- package/lib/index.min.js +1 -1
- package/lib/index.min.js.LICENSE.txt +16 -0
- package/package.json +3 -2
- package/types/ChangePassword/businessRequest.d.ts +2 -1
- package/types/ChangePassword/core/completePassword.d.ts +6 -0
- package/types/ChangePassword/index.d.ts +12 -0
- package/types/CompleteInfo/businessRequest.d.ts +10 -4
- package/types/CompleteInfo/core/completeInfo.d.ts +5 -0
- package/types/CompleteInfo/index.d.ts +11 -0
- package/types/ForgetPassword/index.d.ts +3 -0
- package/types/IdentityBinding/IdentityBinding.d.ts +5 -0
- package/types/IdentityBinding/businessRequest.d.ts +3 -6
- package/types/Login/core/withPassword/FormItemAccount.d.ts +5 -0
- package/types/Login/core/withPassword/GraphicVerifyCode.d.ts +5 -0
- package/types/Login/core/withPassword/InputAccount.d.ts +4 -0
- package/types/Login/core/withPassword/index.d.ts +5 -0
- package/types/Login/hooks/useLoginMultiple.d.ts +1 -1
- package/types/Login/socialLogin/index.d.ts +1 -1
- package/types/MFA/businessRequest.d.ts +11 -0
- package/types/MFA/core/email.d.ts +15 -0
- package/types/MFA/core/face.d.ts +5 -0
- package/types/MFA/core/face_deps.d.ts +6 -0
- package/types/MFA/core/sms.d.ts +10 -0
- package/types/MFA/core/totp.d.ts +17 -0
- package/types/MFA/index.d.ts +4 -0
- package/types/Qrcode/WorkQrCode.d.ts +1 -1
- package/types/RecoveryCode/businessRequest.d.ts +1 -1
- package/types/RecoveryCode/index.d.ts +3 -0
- package/types/Register/core/WithCode.d.ts +7 -1
- package/types/Register/core/WithEmail.d.ts +7 -1
- package/types/Register/interface.d.ts +17 -1
- package/types/SelfUnlock/index.d.ts +4 -0
- package/types/SendCode/SendCodeByPhone.d.ts +1 -1
- package/types/Type/application.d.ts +9 -8
- package/types/Type/index.d.ts +14 -0
- package/types/_utils/config/index.d.ts +11 -3
- package/types/_utils/http.d.ts +17 -0
- package/types/_utils/index.d.ts +16 -3
- package/types/_utils/locales/index.d.ts +2 -1
- package/types/_utils/responseManagement/index.d.ts +6 -0
- package/types/version/version.d.ts +1 -1
- package/types/Login/core/withWeComQrcode.d.ts +0 -2
- package/types/Register/core/WithEmailCode.d.ts +0 -11
- package/types/Register/core/WithPhone.d.ts +0 -10
|
@@ -16,6 +16,22 @@
|
|
|
16
16
|
http://jedwatson.github.io/classnames
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
/*!
|
|
20
|
+
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
|
|
21
|
+
Code licensed under the BSD License:
|
|
22
|
+
http://developer.yahoo.com/yui/license.html
|
|
23
|
+
version: 2.9.0
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @fileOverview
|
|
28
|
+
* @name asn1-1.0.js
|
|
29
|
+
* @author Kenji Urushima kenji.urushima@gmail.com
|
|
30
|
+
* @version asn1 1.0.13 (2017-Jun-02)
|
|
31
|
+
* @since jsrsasign 2.1
|
|
32
|
+
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
33
|
+
*/
|
|
34
|
+
|
|
19
35
|
/**
|
|
20
36
|
* @license
|
|
21
37
|
* Lodash <https://lodash.com/>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authing/react-ui-components",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4-alpha.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "lib/index.min.js",
|
|
6
6
|
"typings": "types/index.d.ts",
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
"antd": "^4.8.0",
|
|
14
14
|
"authing-js-sdk": "4.23.35",
|
|
15
15
|
"classnames": "^2.3.1",
|
|
16
|
-
"
|
|
16
|
+
"axios": "^0.27.2",
|
|
17
17
|
"global": "^4.4.0",
|
|
18
|
+
"jsencrypt": "^3.2.1",
|
|
18
19
|
"phone": "^3.1.12",
|
|
19
20
|
"prompt": "^1.3.0",
|
|
20
21
|
"qs": "^6.9.4",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
1
2
|
export declare enum ChangePasswordBusinessAction {
|
|
2
3
|
ResetPassword = "reset-password-first-time",
|
|
3
4
|
FirstLoginReset = "reset-password-forced",
|
|
@@ -6,4 +7,4 @@ export declare enum ChangePasswordBusinessAction {
|
|
|
6
7
|
export declare const authFlow: (action: ChangePasswordBusinessAction, content: {
|
|
7
8
|
password: string;
|
|
8
9
|
oldPassword?: string;
|
|
9
|
-
}) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
10
|
+
}, config?: AxiosRequestConfig<any> | undefined) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
@@ -3,8 +3,20 @@ export declare const GuardChangePassword: React.FC<{
|
|
|
3
3
|
title: string;
|
|
4
4
|
explain: string;
|
|
5
5
|
}>;
|
|
6
|
+
/**
|
|
7
|
+
* 首次登陆重制密码
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
6
10
|
export declare const GuardFirstLoginPasswordResetView: React.FC;
|
|
7
11
|
export declare const GuardPasswordNotSafeResetView: React.FC;
|
|
8
12
|
export declare const GuardForcedPasswordResetView: React.FC;
|
|
13
|
+
/**
|
|
14
|
+
* 提示修改密码
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
9
17
|
export declare const GuardNoticePasswordResetView: React.FC;
|
|
18
|
+
/**
|
|
19
|
+
* 注册密码补全
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
10
22
|
export declare const GuardRegisterCompletePasswordView: React.FC;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
2
|
import { CompleteInfoRequest, RegisterCompleteInfoInitData } from './interface';
|
|
3
3
|
export declare enum CompleteInfoAuthFlowAction {
|
|
4
4
|
Complete = "complete-completion",
|
|
5
5
|
Skip = "skip-completion"
|
|
6
6
|
}
|
|
7
|
-
export declare const authFlow: (action: CompleteInfoAuthFlowAction, data?: CompleteInfoRequest | undefined) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
export declare const authFlow: (action: CompleteInfoAuthFlowAction, data?: CompleteInfoRequest | undefined, config?: AxiosRequestConfig<any> | undefined) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
8
|
+
/**
|
|
9
|
+
* 注册点击跳过
|
|
10
|
+
* @param fnName
|
|
11
|
+
* @param content
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare const registerSkipMethod: (fnName: RegisterCompleteInfoInitData['businessRequestName'], content: any) => Promise<import("../_utils/http").AuthingGuardResponse<any>> | undefined;
|
|
15
|
+
export declare const registerRequest: (action: CompleteInfoAuthFlowAction, registerFnName: RegisterCompleteInfoInitData['businessRequestName'], registerContent: any, registerProfile?: any) => Promise<import("../_utils/http").AuthingGuardResponse<any> | undefined>;
|
|
@@ -2,10 +2,21 @@ import React from 'react';
|
|
|
2
2
|
import { CompleteInfoMetaData, CompleteInfoRequest } from './interface';
|
|
3
3
|
import './styles.less';
|
|
4
4
|
import { CompleteInfoAuthFlowAction } from './businessRequest';
|
|
5
|
+
/**
|
|
6
|
+
* 登录时信息补全
|
|
7
|
+
* @param param0
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
5
10
|
export declare const GuardCompleteInfo: React.FC<{
|
|
6
11
|
metaData: CompleteInfoMetaData[];
|
|
7
12
|
skipComplateFileds: boolean;
|
|
8
13
|
businessRequest: (action: CompleteInfoAuthFlowAction, data?: CompleteInfoRequest) => Promise<void>;
|
|
9
14
|
}>;
|
|
15
|
+
/**
|
|
16
|
+
* 登录信息补全
|
|
17
|
+
*/
|
|
10
18
|
export declare const GuardLoginCompleteInfoView: React.FC;
|
|
19
|
+
/**
|
|
20
|
+
* 注册信息补全
|
|
21
|
+
*/
|
|
11
22
|
export declare const GuardRegisterCompleteInfoView: React.FC;
|
|
@@ -23,11 +23,8 @@ export declare enum IdentityBindingAction {
|
|
|
23
23
|
BindByPhoneCode = "bind-identity-by-phone-code",
|
|
24
24
|
BindByEmailCode = "bind-identity-by-email-code"
|
|
25
25
|
}
|
|
26
|
-
export declare const PhoneCode: (params: PhoneCodeParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
27
|
-
export declare const EmailCode: (params: EmailCodeParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
28
|
-
export declare const Password: (params: PasswordParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
29
26
|
export declare const useIdentityBindingBusinessRequest: () => {
|
|
30
|
-
"phone-code": (
|
|
31
|
-
"emial-code": (
|
|
32
|
-
password: (
|
|
27
|
+
"phone-code": (data: PhoneCodeParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
28
|
+
"emial-code": (data: EmailCodeParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
29
|
+
password: (data: PasswordParams) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
33
30
|
};
|
|
@@ -4,4 +4,9 @@ import { PasswordLoginMethods } from '../../../Type/application';
|
|
|
4
4
|
export interface FormItemAccountProps extends FormItemProps {
|
|
5
5
|
passwordLoginMethods: PasswordLoginMethods[];
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* 根据对应的配置:邮箱/用户名/Email渲染FormItem
|
|
9
|
+
* @param props
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
7
12
|
export declare const FormItemAccount: React.FC<FormItemAccountProps>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { InputProps } from 'antd/lib/input';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PasswordLoginMethods } from '../../../Type/application';
|
|
4
|
+
/**
|
|
5
|
+
* 账号输入框
|
|
6
|
+
* 根据邮箱/手机号/密码配置自适应
|
|
7
|
+
*/
|
|
4
8
|
export interface InputAccountProps extends InputProps {
|
|
5
9
|
passwordLoginMethods: PasswordLoginMethods[];
|
|
6
10
|
}
|
|
@@ -55,7 +55,7 @@ declare function useLoginMultiple(setLoginWay: React.Dispatch<any>): {
|
|
|
55
55
|
getOriginAccount: () => string;
|
|
56
56
|
getOriginWay: () => string;
|
|
57
57
|
} | undefined;
|
|
58
|
-
referMultipleState: ((type: "
|
|
58
|
+
referMultipleState: ((type: "multiple" | "login") => void) | undefined;
|
|
59
59
|
backfillData: BackFillMultipleState | undefined;
|
|
60
60
|
defaultQrWay: string | undefined;
|
|
61
61
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './style.less';
|
|
3
3
|
import { GuardLocalConfig } from '../../Guard';
|
|
4
|
+
import { ApplicationConfig, SocialConnectionItem } from '../../Type/application';
|
|
4
5
|
import { StoreInstance } from '../../Guard/core/hooks/useMultipleAccounts';
|
|
5
|
-
import { ApplicationConfig, SocialConnectionItem } from '../../Type';
|
|
6
6
|
export interface SocialLoginProps {
|
|
7
7
|
appId: string;
|
|
8
8
|
config: GuardLocalConfig;
|
|
@@ -39,8 +39,19 @@ export declare const AssociateFace: (content: AssociateFaceContent) => Promise<i
|
|
|
39
39
|
export declare const useMfaBusinessRequest: () => {
|
|
40
40
|
"verify-email": (content: VerifyEmailContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
41
41
|
"verify-sms": (content: VerifySmsContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
42
|
+
/**
|
|
43
|
+
* Totp 状态请求
|
|
44
|
+
* @param content
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
42
47
|
"verify-totp": (content: VerifyTotpContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
48
|
+
/**
|
|
49
|
+
* 人脸验证
|
|
50
|
+
*/
|
|
43
51
|
"verify-face": (content: VerifyFaceContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
52
|
+
/**
|
|
53
|
+
* 人脸绑定
|
|
54
|
+
*/
|
|
44
55
|
"associate-face": (content: AssociateFaceContent) => Promise<import("../_utils/http").AuthingGuardResponse<any>>;
|
|
45
56
|
};
|
|
46
57
|
export {};
|
|
@@ -5,6 +5,11 @@ interface BindMFAEmailProps {
|
|
|
5
5
|
onBind: (email: string) => void;
|
|
6
6
|
config: any;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* 绑定邮箱页面
|
|
10
|
+
* @param param0
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
8
13
|
export declare const BindMFAEmail: React.FC<BindMFAEmailProps>;
|
|
9
14
|
interface VerifyMFAEmailProps {
|
|
10
15
|
email: string;
|
|
@@ -13,7 +18,17 @@ interface VerifyMFAEmailProps {
|
|
|
13
18
|
sendCodeRef: React.RefObject<HTMLButtonElement>;
|
|
14
19
|
codeLength: number;
|
|
15
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* 验证邮箱
|
|
23
|
+
* @param param0
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
16
26
|
export declare const VerifyMFAEmail: React.FC<VerifyMFAEmailProps>;
|
|
27
|
+
/**
|
|
28
|
+
* 邮箱验证方式
|
|
29
|
+
* @param param0
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
17
32
|
export declare const MFAEmail: React.FC<{
|
|
18
33
|
mfaToken: string;
|
|
19
34
|
email?: string;
|
package/types/MFA/core/face.d.ts
CHANGED
|
@@ -5,7 +5,13 @@ export declare const devicesConstraints: {
|
|
|
5
5
|
};
|
|
6
6
|
};
|
|
7
7
|
export declare const FACE_SCORE = 0.65;
|
|
8
|
+
/**
|
|
9
|
+
* 人脸检测配置
|
|
10
|
+
*/
|
|
8
11
|
export declare function getFaceDetectorOptions(): any;
|
|
12
|
+
/**
|
|
13
|
+
* 获取 facePlugin tinyFaceDetector 微型人脸探测(三种方式之一)
|
|
14
|
+
*/
|
|
9
15
|
export declare function getCurrentFaceDetectionNet(): any;
|
|
10
16
|
export declare function isFaceDetectionModelLoaded(): boolean;
|
|
11
17
|
export declare function dataURItoBlob(base64Data: any): Blob;
|
package/types/MFA/core/sms.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export interface BindMFASmsProps {
|
|
|
8
8
|
setAreaCode: (areaCode: string) => void;
|
|
9
9
|
isInternationSms: boolean;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* 绑定手机号
|
|
13
|
+
* @param param0
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
11
16
|
export declare const BindMFASms: React.FC<BindMFASmsProps>;
|
|
12
17
|
export interface VerifyMFASmsProps {
|
|
13
18
|
mfaToken: string;
|
|
@@ -21,6 +26,11 @@ export interface VerifyMFASmsProps {
|
|
|
21
26
|
userPhone?: string;
|
|
22
27
|
}
|
|
23
28
|
export declare const VerifyMFASms: React.FC<VerifyMFASmsProps>;
|
|
29
|
+
/**
|
|
30
|
+
* 手机 MFA
|
|
31
|
+
* @param param0
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
24
34
|
export declare const MFASms: React.FC<{
|
|
25
35
|
mfaLogin: any;
|
|
26
36
|
config: MFAConfig;
|
package/types/MFA/core/totp.d.ts
CHANGED
|
@@ -4,12 +4,22 @@ export interface BindMFATotpProps {
|
|
|
4
4
|
initData: GuardMFAInitData;
|
|
5
5
|
changeModule: any;
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* 绑定 ToTp 页面 跳转 Totp
|
|
9
|
+
* @param param0
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
7
12
|
export declare const BindMFATotp: React.FC<BindMFATotpProps>;
|
|
8
13
|
export interface VerifyMFATotpProps {
|
|
9
14
|
mfaToken: string;
|
|
10
15
|
mfaLogin: any;
|
|
11
16
|
changeModule: any;
|
|
12
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Totp 验证页面
|
|
20
|
+
* @param param0
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
13
23
|
export declare const VerifyMFATotp: React.FC<VerifyMFATotpProps>;
|
|
14
24
|
export interface MFATotpProps {
|
|
15
25
|
changeModule: any;
|
|
@@ -17,4 +27,11 @@ export interface MFATotpProps {
|
|
|
17
27
|
initData: GuardMFAInitData;
|
|
18
28
|
mfaLogin: any;
|
|
19
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* MFA Totp 页面
|
|
32
|
+
* 开启 => 渲染 VerifyMFATotp 绑定
|
|
33
|
+
* 不开启 => 渲染绑定页面
|
|
34
|
+
* @param param
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
20
37
|
export declare const MFATotp: React.FC<MFATotpProps>;
|
package/types/MFA/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface WorkQrCodeRef {
|
|
|
11
11
|
url: string;
|
|
12
12
|
} | undefined>;
|
|
13
13
|
}
|
|
14
|
-
interface WorkQrCodeProps extends Omit<UiQrProps, 'description' | 'status'> {
|
|
14
|
+
export interface WorkQrCodeProps extends Omit<UiQrProps, 'description' | 'status'> {
|
|
15
15
|
/**
|
|
16
16
|
* 二维码场景
|
|
17
17
|
*/
|
|
@@ -2,4 +2,4 @@ export declare enum TotpRecoveryCodeBusinessAction {
|
|
|
2
2
|
RecoveryTotp = "recovery-totp",
|
|
3
3
|
ConfirmTotpRecoveryCode = "confirm-totp-recovery-code"
|
|
4
4
|
}
|
|
5
|
-
export declare function authFlow<T>(action: TotpRecoveryCodeBusinessAction,
|
|
5
|
+
export declare function authFlow<T>(action: TotpRecoveryCodeBusinessAction, data: any): Promise<import("../_utils/http").AuthingGuardResponse<T>>;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Agreement, ApplicationConfig } from '../../Type/application';
|
|
3
|
+
import { GetRegisterEvent } from '../interface';
|
|
3
4
|
export interface RegisterWithCodeProps {
|
|
4
5
|
onRegisterSuccess: Function;
|
|
5
6
|
onRegisterFailed: Function;
|
|
6
|
-
onBeforeRegister?:
|
|
7
|
+
onBeforeRegister?: GetRegisterEvent<'onBeforeRegister'>;
|
|
7
8
|
agreements: Agreement[];
|
|
8
9
|
publicConfig?: ApplicationConfig;
|
|
9
10
|
registeContext?: any;
|
|
10
11
|
methods: any[];
|
|
11
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* 验证码方式注册
|
|
15
|
+
* @param param
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
12
18
|
export declare const RegisterWithCode: React.FC<RegisterWithCodeProps>;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { GetRegisterEvent } from '../interface';
|
|
2
3
|
import { Agreement, ApplicationConfig } from '../../Type/application';
|
|
3
4
|
export interface RegisterWithEmailProps {
|
|
4
5
|
onRegisterSuccess: Function;
|
|
5
6
|
onRegisterFailed: Function;
|
|
6
|
-
onBeforeRegister?:
|
|
7
|
+
onBeforeRegister?: GetRegisterEvent<'onBeforeRegister'>;
|
|
7
8
|
publicConfig?: ApplicationConfig;
|
|
8
9
|
agreements: Agreement[];
|
|
9
10
|
registeContext?: any;
|
|
10
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* 邮箱 + 密码注册 头部显示密码注册
|
|
14
|
+
* @param param
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
11
17
|
export declare const RegisterWithEmail: React.FC<RegisterWithEmailProps>;
|
|
@@ -10,8 +10,24 @@ export interface RegisterConfig extends IG2Config {
|
|
|
10
10
|
agreements?: Agreement[];
|
|
11
11
|
registerContext?: any;
|
|
12
12
|
}
|
|
13
|
+
export declare type SupportRegisterMethods = 'email' | 'email-code' | 'phone-code';
|
|
14
|
+
/**
|
|
15
|
+
* 注册前回调事件接受参数
|
|
16
|
+
*/
|
|
17
|
+
export interface onBeforeRegisterParams {
|
|
18
|
+
type: SupportRegisterMethods;
|
|
19
|
+
data: {
|
|
20
|
+
account: string;
|
|
21
|
+
password?: string;
|
|
22
|
+
code?: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 获取用户注册事件的类型
|
|
27
|
+
*/
|
|
28
|
+
export declare type GetRegisterEvent<T extends keyof RegisterEvents> = RegisterEvents[T];
|
|
13
29
|
export interface RegisterEvents extends IG2Events {
|
|
14
|
-
onBeforeRegister?: (registerInfo:
|
|
30
|
+
onBeforeRegister?: (registerInfo: onBeforeRegisterParams, authClient: AuthenticationClient) => boolean | Promise<boolean>;
|
|
15
31
|
onRegister?: (user: User, authClient: AuthenticationClient) => void;
|
|
16
32
|
onRegisterError?: (error: any) => void;
|
|
17
33
|
onRegisterTabChange?: (activeTab: RegisterMethods) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { SceneType } from 'authing-js-sdk';
|
|
3
2
|
import './style.less';
|
|
4
3
|
import { InputProps } from 'antd/lib/input';
|
|
4
|
+
import { SceneType } from 'components/Type';
|
|
5
5
|
export interface SendCodeByPhoneProps extends InputProps {
|
|
6
6
|
data?: string;
|
|
7
7
|
form?: any;
|
|
@@ -7,8 +7,7 @@ export declare enum LoginMethods {
|
|
|
7
7
|
PhoneCode = "phone-code",
|
|
8
8
|
WxMinQr = "wechat-miniprogram-qrcode",
|
|
9
9
|
AD = "ad",
|
|
10
|
-
WechatMpQrcode = "wechatmp-qrcode"
|
|
11
|
-
WechatworkCorpQrconnect = "wechatwork-corp-qrconnect"
|
|
10
|
+
WechatMpQrcode = "wechatmp-qrcode"
|
|
12
11
|
}
|
|
13
12
|
export declare enum OIDCConnectionMode {
|
|
14
13
|
FRONT_CHANNEL = "FRONT_CHANNEL",
|
|
@@ -106,12 +105,6 @@ export declare type QrcodeTabsSettings = Record<LoginMethods, Array<{
|
|
|
106
105
|
id: string;
|
|
107
106
|
title: string;
|
|
108
107
|
isDefault?: boolean;
|
|
109
|
-
QRConfig?: {
|
|
110
|
-
corpId: string;
|
|
111
|
-
agentId: string;
|
|
112
|
-
redirectUrl: string;
|
|
113
|
-
identifier: string;
|
|
114
|
-
};
|
|
115
108
|
}>>;
|
|
116
109
|
export interface OidcClientMetadata {
|
|
117
110
|
grant_types: string[];
|
|
@@ -261,4 +254,12 @@ export interface ApplicationConfig {
|
|
|
261
254
|
skipComplateFileds: boolean;
|
|
262
255
|
selfUnlockStrategy: 'captcha' | 'password-captcha';
|
|
263
256
|
defaultLanguageConfig: Lang;
|
|
257
|
+
/**
|
|
258
|
+
* 是否开启账号切换
|
|
259
|
+
*/
|
|
260
|
+
enableLoginAccountSwitch: boolean;
|
|
261
|
+
/**
|
|
262
|
+
* 是否开启注册密码补全
|
|
263
|
+
*/
|
|
264
|
+
enableCompletePassword: boolean;
|
|
264
265
|
}
|
package/types/Type/index.d.ts
CHANGED
|
@@ -82,3 +82,17 @@ export declare enum EmailScene {
|
|
|
82
82
|
EMAIL_UNBIND_VERIFY_CODE = "EMAIL_UNBIND_VERIFY_CODE",
|
|
83
83
|
SELF_UNLOCKING_VERIFY_CODE = "SELF_UNLOCKING_VERIFY_CODE"
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* 验证码场景类型
|
|
87
|
+
*/
|
|
88
|
+
export declare enum SceneType {
|
|
89
|
+
SCENE_TYPE_LOGIN = "login",
|
|
90
|
+
SCENE_TYPE_REGISTER = "register",
|
|
91
|
+
SCENE_TYPE_RESET = "reset",
|
|
92
|
+
SCENE_TYPE_BIND = "bind",
|
|
93
|
+
SCENE_TYPE_UNBIND = "unbind",
|
|
94
|
+
SCENE_TYPE_MFA_BIND = "mfa-bind",
|
|
95
|
+
SCENE_TYPE_MFA_VERIFY = "mfa-verify",
|
|
96
|
+
SCENE_TYPE_MFA_UNBIND = "mfa-unbind",
|
|
97
|
+
SCENE_TYPE_COMPLETE_PHONE = "complete-phone"
|
|
98
|
+
}
|
|
@@ -6,6 +6,14 @@ import { ApplicationConfig, RegisterMethods } from '../../Type/application';
|
|
|
6
6
|
export declare const getPublicConfig: (appId: string) => ApplicationConfig;
|
|
7
7
|
export declare const setPublicConfig: (appId: string, config: ApplicationConfig) => ApplicationConfig;
|
|
8
8
|
export declare const useMergeDefaultConfig: (defaultConfig: GuardLocalConfig, config?: GuardComponentConfig | undefined) => GuardLocalConfig | undefined;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param appId
|
|
12
|
+
* @param config 默认配置
|
|
13
|
+
* @param httpClient
|
|
14
|
+
* @param setError
|
|
15
|
+
* @returns 合并后的 finallyConfig
|
|
16
|
+
*/
|
|
9
17
|
export declare const useMergePublicConfig: (forceUpdate: number, appId?: string | undefined, config?: GuardLocalConfig | undefined, httpClient?: GuardHttp | undefined, setError?: any) => {
|
|
10
18
|
host: string;
|
|
11
19
|
isSSO?: boolean | undefined;
|
|
@@ -42,7 +50,7 @@ export declare const useMergePublicConfig: (forceUpdate: number, appId?: string
|
|
|
42
50
|
loginMethods?: import("../../Type").LoginMethods[] | undefined;
|
|
43
51
|
passwordLoginMethods?: import("../../Type").PasswordLoginMethods[] | undefined;
|
|
44
52
|
socialConnections?: import("authing-js-sdk").SocialConnectionProvider[] | undefined;
|
|
45
|
-
socialConnectionsBtnShape?: "
|
|
53
|
+
socialConnectionsBtnShape?: "button" | "default" | "icon" | undefined;
|
|
46
54
|
enterpriseConnections?: string[] | undefined;
|
|
47
55
|
qrCodeScanOptions?: {
|
|
48
56
|
extIdpConnId?: string | undefined;
|
|
@@ -92,5 +100,5 @@ export declare const useMergePublicConfig: (forceUpdate: number, appId?: string
|
|
|
92
100
|
} | undefined;
|
|
93
101
|
export declare const getPageConfig: (appId: string) => GuardPageConfig;
|
|
94
102
|
export declare const setPageConfig: (appId: string, config: GuardPageConfig) => GuardPageConfig;
|
|
95
|
-
export declare const requestGuardPageConfig: (appId: string,
|
|
96
|
-
export declare const useGuardPageConfig: (forceUpdate: number, appId?: string | undefined,
|
|
103
|
+
export declare const requestGuardPageConfig: (appId: string, baseURL?: string | undefined) => Promise<GuardPageConfig>;
|
|
104
|
+
export declare const useGuardPageConfig: (forceUpdate: number, appId?: string | undefined, defaultConfig?: GuardLocalConfig | undefined, serError?: any) => GuardPageConfig | undefined;
|
package/types/_utils/http.d.ts
CHANGED
|
@@ -28,6 +28,23 @@ export interface AuthingResponse<T = any> {
|
|
|
28
28
|
flowHandle?: string;
|
|
29
29
|
}
|
|
30
30
|
export interface AuthingGuardResponse<T = any> extends AuthingResponse<T> {
|
|
31
|
+
/**
|
|
32
|
+
* 根据 Server 返回状态进行的状态流转函数
|
|
33
|
+
* 默认响应拦截器中自动调用
|
|
34
|
+
*/
|
|
31
35
|
onGuardHandling?: () => CodeAction;
|
|
36
|
+
/**
|
|
37
|
+
* Response 返回 actions 是否需要模块内部处理
|
|
38
|
+
* 根据 status === 200 判断
|
|
39
|
+
*/
|
|
40
|
+
isBusiness?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 流程是否结束(兼容老版本字段)
|
|
43
|
+
*/
|
|
32
44
|
isFlowEnd?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 本次响应 Action 类型
|
|
47
|
+
* see: packages/react-components/components/_utils/responseManagement/interface.ts
|
|
48
|
+
*/
|
|
49
|
+
responseActionType?: CodeAction;
|
|
33
50
|
}
|
package/types/_utils/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Rule } from 'antd/lib/form';
|
|
1
|
+
import { FormInstance, Rule, RuleObject } from 'antd/lib/form';
|
|
2
2
|
import qs from 'qs';
|
|
3
3
|
import { User } from 'authing-js-sdk';
|
|
4
4
|
import { GuardProps } from '../Guard';
|
|
5
5
|
import { ApplicationConfig, ComplateFiledsPlace, LoginMethods, RegisterMethods } from '../Type/application';
|
|
6
6
|
import { Lang } from '../Type';
|
|
7
|
+
import { InputMethod } from 'components';
|
|
7
8
|
export * from './popupCenter';
|
|
8
9
|
export * from './clipboard';
|
|
9
10
|
export declare const VALIDATE_PATTERN: {
|
|
@@ -16,6 +17,20 @@ export declare const VALIDATE_PATTERN: {
|
|
|
16
17
|
export declare const validate: (type: keyof typeof VALIDATE_PATTERN, val: string) => boolean;
|
|
17
18
|
export declare const getRequiredRules: (msg: string) => Rule[];
|
|
18
19
|
export declare const fieldRequiredRule: (fieldRequiredRule: string, fieldRequiredRuleMessage?: string | undefined) => Rule[];
|
|
20
|
+
/**
|
|
21
|
+
* 验证码是否正确
|
|
22
|
+
* @param form form 实例
|
|
23
|
+
* @param key 当前 FormItem 对应值的 key,比如当前为邮箱验证码就传入邮箱输入框的 formItem name
|
|
24
|
+
* @returns Array
|
|
25
|
+
*/
|
|
26
|
+
export declare const fieldCodeCorrect: (form: FormInstance, key: string | undefined, options: {
|
|
27
|
+
currentMethod: InputMethod;
|
|
28
|
+
areaCode: string;
|
|
29
|
+
isInternationSms?: boolean | undefined;
|
|
30
|
+
}) => {
|
|
31
|
+
validateTrigger: string[];
|
|
32
|
+
validator: (rule: RuleObject, value: string) => Promise<void>;
|
|
33
|
+
}[];
|
|
19
34
|
export declare function getDeviceName(): string | null | undefined;
|
|
20
35
|
export declare type STYLE_RECORD_KEY = 'appConfig' | 'userConfig';
|
|
21
36
|
export declare const insertStyles: (styles: string | any, recordKey?: "appConfig" | "userConfig" | undefined) => void;
|
|
@@ -90,5 +105,3 @@ export declare const getLoginTypePipe: (publicConfig: ApplicationConfig, registe
|
|
|
90
105
|
} | undefined;
|
|
91
106
|
export declare const getPasswordIdentify: (identity: string) => string;
|
|
92
107
|
export declare const getCurrentLng: () => Lang;
|
|
93
|
-
export declare const isDingTalkOrigin: (origin: string) => boolean;
|
|
94
|
-
export declare const isWeComOrigin: (event: MessageEvent) => boolean;
|