@springmicro/auth 0.7.5 → 0.7.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.
Files changed (45) hide show
  1. package/README.md +60 -60
  2. package/package.json +2 -2
  3. package/src/components/forms/AgreementModal.tsx +88 -88
  4. package/src/components/forms/CaptchaController.tsx +94 -94
  5. package/src/components/forms/CaptchaModal.jsx +171 -171
  6. package/src/components/forms/CaptchaWidget.jsx +146 -146
  7. package/src/components/forms/PasswordChecker.ts +88 -88
  8. package/src/components/forms/util/auth-api.ts +198 -198
  9. package/src/components/forms/util/auth-util.tsx +346 -346
  10. package/src/components/forms/util/core.ts +493 -493
  11. package/src/components/forms/util/invitation-api.ts +132 -132
  12. package/src/components/forms/util/provider.tsx +603 -603
  13. package/src/components/provider/AdfsLoginButton.jsx +38 -38
  14. package/src/components/provider/AlipayLoginButton.jsx +38 -38
  15. package/src/components/provider/AppleLoginButton.jsx +38 -38
  16. package/src/components/provider/AzureADB2CLoginButton.jsx +38 -38
  17. package/src/components/provider/AzureADLoginButton.jsx +38 -38
  18. package/src/components/provider/BaiduLoginButton.jsx +38 -38
  19. package/src/components/provider/BilibiliLoginButton.jsx +37 -37
  20. package/src/components/provider/CasdoorLoginButton.jsx +38 -38
  21. package/src/components/provider/DingTalkLoginButton.jsx +37 -37
  22. package/src/components/provider/DouyinLoginButton.jsx +38 -38
  23. package/src/components/provider/FacebookLoginButton.jsx +37 -37
  24. package/src/components/provider/GitHubLoginButton.jsx +37 -37
  25. package/src/components/provider/GitLabLoginButton.jsx +38 -38
  26. package/src/components/provider/GiteeLoginButton.jsx +34 -34
  27. package/src/components/provider/GoogleLoginButton.jsx +68 -68
  28. package/src/components/provider/InfoflowLoginButton.jsx +38 -38
  29. package/src/components/provider/LarkLoginButton.jsx +38 -38
  30. package/src/components/provider/LinkedInLoginButton.jsx +37 -37
  31. package/src/components/provider/LoginButton.jsx +33 -33
  32. package/src/components/provider/OktaLoginButton.jsx +38 -38
  33. package/src/components/provider/Provider.jsx +3 -3
  34. package/src/components/provider/ProviderButton.jsx +327 -327
  35. package/src/components/provider/QqLoginButton.jsx +31 -31
  36. package/src/components/provider/SelfLoginButton.jsx +47 -47
  37. package/src/components/provider/SlackLoginButton.jsx +38 -38
  38. package/src/components/provider/SteamLoginButton.jsx +38 -38
  39. package/src/components/provider/WeComLoginButton.jsx +34 -34
  40. package/src/components/provider/Web3Auth.jsx +365 -365
  41. package/src/components/provider/WechatLoginButton.jsx +37 -37
  42. package/src/components/provider/WeiboLoginButton.jsx +34 -34
  43. package/src/i18n/en/signup.json +48 -48
  44. package/src/i18n/index.ts +17 -17
  45. package/vite.config.ts +33 -33
@@ -1,171 +1,171 @@
1
- // Copyright 2022 The Casdoor Authors. All Rights Reserved.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- import React, { useEffect } from "react";
16
- import * as UserBackend from "./util/user-api";
17
- import { CaptchaWidget } from "./CaptchaWidget";
18
- import { useTranslation } from "react-i18next";
19
-
20
- export const CaptchaModal = (props) => {
21
- const { t } = useTranslation();
22
- const { owner, name, visible, onOk, onCancel, isCurrentProvider } = props;
23
-
24
- const [captchaType, setCaptchaType] = React.useState("none");
25
- const [clientId, setClientId] = React.useState("");
26
- const [clientSecret, setClientSecret] = React.useState("");
27
- const [subType, setSubType] = React.useState("");
28
- const [clientId2, setClientId2] = React.useState("");
29
- const [clientSecret2, setClientSecret2] = React.useState("");
30
-
31
- const [open, setOpen] = React.useState(false);
32
- const [captchaImg, setCaptchaImg] = React.useState("");
33
- const [captchaToken, setCaptchaToken] = React.useState("");
34
-
35
- const defaultInputRef = React.useRef(null);
36
-
37
- useEffect(() => {
38
- if (visible) {
39
- loadCaptcha();
40
- } else {
41
- handleCancel();
42
- setOpen(false);
43
- }
44
- }, [visible]);
45
-
46
- const handleOk = () => {
47
- onOk?.(captchaType, captchaToken, clientSecret);
48
- };
49
-
50
- const handleCancel = () => {
51
- setCaptchaToken("");
52
- onCancel?.();
53
- };
54
-
55
- const loadCaptcha = () => {
56
- UserBackend.getCaptcha(owner, name, isCurrentProvider).then((res) => {
57
- if (res.type === "none") {
58
- handleOk();
59
- } else if (res.type === "Default") {
60
- setOpen(true);
61
- setClientSecret(res.captchaId);
62
- setCaptchaImg(res.captchaImage);
63
- setCaptchaType("Default");
64
- } else {
65
- setOpen(true);
66
- setCaptchaType(res.type);
67
- setClientId(res.clientId);
68
- setClientSecret(res.clientSecret);
69
- setSubType(res.subType);
70
- setClientId2(res.clientId2);
71
- setClientSecret2(res.clientSecret2);
72
- }
73
- });
74
- };
75
-
76
- const renderDefaultCaptcha = () => {
77
- return (
78
- <div className="flex flex-col items-center">
79
- <div
80
- className="bg-no-repeat mb-4 border border-current rounded w-[200px] h-[80px]"
81
- style={{
82
- backgroundImage: `url('data:image/png;base64,${captchaImg}')`,
83
- }}
84
- />
85
- <input
86
- className="input input-bordered w-[200px]"
87
- type="text"
88
- ref={defaultInputRef}
89
- value={captchaToken}
90
- // prefix={<SafetyOutlined />}
91
- placeholder={t("general.captcha")}
92
- onKeyDown={(e) => (e.key === "Enter" ? handleOk() : null)}
93
- onChange={(e) => setCaptchaToken(e.target.value)}
94
- />
95
- </div>
96
- );
97
- };
98
-
99
- const onChange = (token) => {
100
- setCaptchaToken(token);
101
- };
102
-
103
- const renderCaptcha = () => {
104
- if (captchaType === "Default") {
105
- return renderDefaultCaptcha();
106
- } else {
107
- return (
108
- <div className="flex justify-center">
109
- <CaptchaWidget
110
- captchaType={captchaType}
111
- subType={subType}
112
- siteKey={clientId}
113
- clientSecret={clientSecret}
114
- onChange={onChange}
115
- clientId2={clientId2}
116
- clientSecret2={clientSecret2}
117
- />
118
- </div>
119
- );
120
- }
121
- };
122
-
123
- const renderFooter = () => {
124
- let isOkDisabled = false;
125
- if (captchaType === "Default") {
126
- const regex = /^\d{5}$/;
127
- if (!regex.test(captchaToken)) {
128
- isOkDisabled = true;
129
- }
130
- } else if (captchaToken === "") {
131
- isOkDisabled = true;
132
- }
133
-
134
- return [
135
- <button className="btn" onClick={handleCancel} key="closebtn">
136
- Cancel
137
- </button>,
138
- <button
139
- className="btn btn-primary"
140
- disabled={isOkDisabled}
141
- onClick={handleOk}
142
- key="okbtn"
143
- >
144
- OK
145
- </button>,
146
- ];
147
- };
148
-
149
- return (
150
- <dialog id="captcha-modal" className="modal">
151
- <div className="modal-box">
152
- <div className="mt-4 mb-8">{renderCaptcha()}</div>
153
- <div className="modal-action">
154
- <form method="dialog" className="modal-backdrop">
155
- {/* if there is a button in form, it will close the modal */}
156
- <button>Close</button>
157
- </form>
158
- <form method="dialog" className="flex gap-3">
159
- {renderFooter()}
160
- </form>
161
- </div>
162
- </div>
163
- </dialog>
164
- );
165
- };
166
-
167
- export const CaptchaRule = {
168
- Always: "Always",
169
- Never: "Never",
170
- Dynamic: "Dynamic",
171
- };
1
+ // Copyright 2022 The Casdoor Authors. All Rights Reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ import React, { useEffect } from "react";
16
+ import * as UserBackend from "./util/user-api";
17
+ import { CaptchaWidget } from "./CaptchaWidget";
18
+ import { useTranslation } from "react-i18next";
19
+
20
+ export const CaptchaModal = (props) => {
21
+ const { t } = useTranslation();
22
+ const { owner, name, visible, onOk, onCancel, isCurrentProvider } = props;
23
+
24
+ const [captchaType, setCaptchaType] = React.useState("none");
25
+ const [clientId, setClientId] = React.useState("");
26
+ const [clientSecret, setClientSecret] = React.useState("");
27
+ const [subType, setSubType] = React.useState("");
28
+ const [clientId2, setClientId2] = React.useState("");
29
+ const [clientSecret2, setClientSecret2] = React.useState("");
30
+
31
+ const [open, setOpen] = React.useState(false);
32
+ const [captchaImg, setCaptchaImg] = React.useState("");
33
+ const [captchaToken, setCaptchaToken] = React.useState("");
34
+
35
+ const defaultInputRef = React.useRef(null);
36
+
37
+ useEffect(() => {
38
+ if (visible) {
39
+ loadCaptcha();
40
+ } else {
41
+ handleCancel();
42
+ setOpen(false);
43
+ }
44
+ }, [visible]);
45
+
46
+ const handleOk = () => {
47
+ onOk?.(captchaType, captchaToken, clientSecret);
48
+ };
49
+
50
+ const handleCancel = () => {
51
+ setCaptchaToken("");
52
+ onCancel?.();
53
+ };
54
+
55
+ const loadCaptcha = () => {
56
+ UserBackend.getCaptcha(owner, name, isCurrentProvider).then((res) => {
57
+ if (res.type === "none") {
58
+ handleOk();
59
+ } else if (res.type === "Default") {
60
+ setOpen(true);
61
+ setClientSecret(res.captchaId);
62
+ setCaptchaImg(res.captchaImage);
63
+ setCaptchaType("Default");
64
+ } else {
65
+ setOpen(true);
66
+ setCaptchaType(res.type);
67
+ setClientId(res.clientId);
68
+ setClientSecret(res.clientSecret);
69
+ setSubType(res.subType);
70
+ setClientId2(res.clientId2);
71
+ setClientSecret2(res.clientSecret2);
72
+ }
73
+ });
74
+ };
75
+
76
+ const renderDefaultCaptcha = () => {
77
+ return (
78
+ <div className="flex flex-col items-center">
79
+ <div
80
+ className="bg-no-repeat mb-4 border border-current rounded w-[200px] h-[80px]"
81
+ style={{
82
+ backgroundImage: `url('data:image/png;base64,${captchaImg}')`,
83
+ }}
84
+ />
85
+ <input
86
+ className="input input-bordered w-[200px]"
87
+ type="text"
88
+ ref={defaultInputRef}
89
+ value={captchaToken}
90
+ // prefix={<SafetyOutlined />}
91
+ placeholder={t("general.captcha")}
92
+ onKeyDown={(e) => (e.key === "Enter" ? handleOk() : null)}
93
+ onChange={(e) => setCaptchaToken(e.target.value)}
94
+ />
95
+ </div>
96
+ );
97
+ };
98
+
99
+ const onChange = (token) => {
100
+ setCaptchaToken(token);
101
+ };
102
+
103
+ const renderCaptcha = () => {
104
+ if (captchaType === "Default") {
105
+ return renderDefaultCaptcha();
106
+ } else {
107
+ return (
108
+ <div className="flex justify-center">
109
+ <CaptchaWidget
110
+ captchaType={captchaType}
111
+ subType={subType}
112
+ siteKey={clientId}
113
+ clientSecret={clientSecret}
114
+ onChange={onChange}
115
+ clientId2={clientId2}
116
+ clientSecret2={clientSecret2}
117
+ />
118
+ </div>
119
+ );
120
+ }
121
+ };
122
+
123
+ const renderFooter = () => {
124
+ let isOkDisabled = false;
125
+ if (captchaType === "Default") {
126
+ const regex = /^\d{5}$/;
127
+ if (!regex.test(captchaToken)) {
128
+ isOkDisabled = true;
129
+ }
130
+ } else if (captchaToken === "") {
131
+ isOkDisabled = true;
132
+ }
133
+
134
+ return [
135
+ <button className="btn" onClick={handleCancel} key="closebtn">
136
+ Cancel
137
+ </button>,
138
+ <button
139
+ className="btn btn-primary"
140
+ disabled={isOkDisabled}
141
+ onClick={handleOk}
142
+ key="okbtn"
143
+ >
144
+ OK
145
+ </button>,
146
+ ];
147
+ };
148
+
149
+ return (
150
+ <dialog id="captcha-modal" className="modal">
151
+ <div className="modal-box">
152
+ <div className="mt-4 mb-8">{renderCaptcha()}</div>
153
+ <div className="modal-action">
154
+ <form method="dialog" className="modal-backdrop">
155
+ {/* if there is a button in form, it will close the modal */}
156
+ <button>Close</button>
157
+ </form>
158
+ <form method="dialog" className="flex gap-3">
159
+ {renderFooter()}
160
+ </form>
161
+ </div>
162
+ </div>
163
+ </dialog>
164
+ );
165
+ };
166
+
167
+ export const CaptchaRule = {
168
+ Always: "Always",
169
+ Never: "Never",
170
+ Dynamic: "Dynamic",
171
+ };
@@ -1,146 +1,146 @@
1
- // Copyright 2022 The Casdoor Authors. All Rights Reserved.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- import React, { useEffect } from "react";
16
-
17
- export const CaptchaWidget = (props) => {
18
- const {
19
- captchaType,
20
- subType,
21
- siteKey,
22
- clientSecret,
23
- clientId2,
24
- clientSecret2,
25
- onChange,
26
- } = props;
27
-
28
- const loadScript = (src) => {
29
- const tag = document.createElement("script");
30
- tag.async = false;
31
- tag.src = src;
32
- const body = document.getElementsByTagName("body")[0];
33
- body.appendChild(tag);
34
- };
35
-
36
- useEffect(() => {
37
- switch (captchaType) {
38
- case "reCAPTCHA": {
39
- const reTimer = setInterval(() => {
40
- if (!window.grecaptcha) {
41
- loadScript("https://recaptcha.net/recaptcha/api.js");
42
- }
43
- if (window.grecaptcha && window.grecaptcha.render) {
44
- window.grecaptcha.render("captcha", {
45
- sitekey: siteKey,
46
- callback: onChange,
47
- });
48
- clearInterval(reTimer);
49
- }
50
- }, 300);
51
- break;
52
- }
53
- case "hCaptcha": {
54
- const hTimer = setInterval(() => {
55
- if (!window.hcaptcha) {
56
- loadScript("https://js.hcaptcha.com/1/api.js");
57
- }
58
- if (window.hcaptcha && window.hcaptcha.render) {
59
- window.hcaptcha.render("captcha", {
60
- sitekey: siteKey,
61
- callback: onChange,
62
- });
63
- clearInterval(hTimer);
64
- }
65
- }, 300);
66
- break;
67
- }
68
- case "Aliyun Captcha": {
69
- const AWSCTimer = setInterval(() => {
70
- if (!window.AWSC) {
71
- loadScript("https://g.alicdn.com/AWSC/AWSC/awsc.js");
72
- }
73
-
74
- if (window.AWSC) {
75
- if (clientSecret2 && clientSecret2 !== "***") {
76
- window.AWSC.use(subType, function (state, module) {
77
- module.init({
78
- appkey: clientSecret2,
79
- scene: clientId2,
80
- renderTo: "captcha",
81
- success: function (data) {
82
- onChange(
83
- `SessionId=${data.sessionId}&AccessKeyId=${siteKey}&Scene=${clientId2}&AppKey=${clientSecret2}&Token=${data.token}&Sig=${data.sig}&RemoteIp=192.168.0.1`
84
- );
85
- },
86
- });
87
- });
88
- }
89
- clearInterval(AWSCTimer);
90
- }
91
- }, 300);
92
- break;
93
- }
94
- case "GEETEST": {
95
- let getLock = false;
96
- const gTimer = setInterval(() => {
97
- if (!window.initGeetest4) {
98
- loadScript("https://static.geetest.com/v4/gt4.js");
99
- }
100
- if (window.initGeetest4 && siteKey && !getLock) {
101
- const captchaId = String(siteKey);
102
- window.initGeetest4(
103
- {
104
- captchaId,
105
- product: "float",
106
- },
107
- function (captchaObj) {
108
- if (!getLock) {
109
- captchaObj.appendTo("#captcha");
110
- getLock = true;
111
- }
112
- captchaObj.onSuccess(function () {
113
- const result = captchaObj.getValidate();
114
- onChange(
115
- `lot_number=${result.lot_number}&captcha_output=${result.captcha_output}&pass_token=${result.pass_token}&gen_time=${result.gen_time}&captcha_id=${siteKey}`
116
- );
117
- });
118
- }
119
- );
120
- clearInterval(gTimer);
121
- }
122
- }, 500);
123
- break;
124
- }
125
- case "Cloudflare Turnstile": {
126
- const tTimer = setInterval(() => {
127
- if (!window.turnstile) {
128
- loadScript("https://challenges.cloudflare.com/turnstile/v0/api.js");
129
- }
130
- if (window.turnstile && window.turnstile.render) {
131
- window.turnstile.render("#captcha", {
132
- sitekey: siteKey,
133
- callback: onChange,
134
- });
135
- clearInterval(tTimer);
136
- }
137
- }, 300);
138
- break;
139
- }
140
- default:
141
- break;
142
- }
143
- }, [captchaType, subType, siteKey, clientSecret, clientId2, clientSecret2]);
144
-
145
- return <div id="captcha" />;
146
- };
1
+ // Copyright 2022 The Casdoor Authors. All Rights Reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ import React, { useEffect } from "react";
16
+
17
+ export const CaptchaWidget = (props) => {
18
+ const {
19
+ captchaType,
20
+ subType,
21
+ siteKey,
22
+ clientSecret,
23
+ clientId2,
24
+ clientSecret2,
25
+ onChange,
26
+ } = props;
27
+
28
+ const loadScript = (src) => {
29
+ const tag = document.createElement("script");
30
+ tag.async = false;
31
+ tag.src = src;
32
+ const body = document.getElementsByTagName("body")[0];
33
+ body.appendChild(tag);
34
+ };
35
+
36
+ useEffect(() => {
37
+ switch (captchaType) {
38
+ case "reCAPTCHA": {
39
+ const reTimer = setInterval(() => {
40
+ if (!window.grecaptcha) {
41
+ loadScript("https://recaptcha.net/recaptcha/api.js");
42
+ }
43
+ if (window.grecaptcha && window.grecaptcha.render) {
44
+ window.grecaptcha.render("captcha", {
45
+ sitekey: siteKey,
46
+ callback: onChange,
47
+ });
48
+ clearInterval(reTimer);
49
+ }
50
+ }, 300);
51
+ break;
52
+ }
53
+ case "hCaptcha": {
54
+ const hTimer = setInterval(() => {
55
+ if (!window.hcaptcha) {
56
+ loadScript("https://js.hcaptcha.com/1/api.js");
57
+ }
58
+ if (window.hcaptcha && window.hcaptcha.render) {
59
+ window.hcaptcha.render("captcha", {
60
+ sitekey: siteKey,
61
+ callback: onChange,
62
+ });
63
+ clearInterval(hTimer);
64
+ }
65
+ }, 300);
66
+ break;
67
+ }
68
+ case "Aliyun Captcha": {
69
+ const AWSCTimer = setInterval(() => {
70
+ if (!window.AWSC) {
71
+ loadScript("https://g.alicdn.com/AWSC/AWSC/awsc.js");
72
+ }
73
+
74
+ if (window.AWSC) {
75
+ if (clientSecret2 && clientSecret2 !== "***") {
76
+ window.AWSC.use(subType, function (state, module) {
77
+ module.init({
78
+ appkey: clientSecret2,
79
+ scene: clientId2,
80
+ renderTo: "captcha",
81
+ success: function (data) {
82
+ onChange(
83
+ `SessionId=${data.sessionId}&AccessKeyId=${siteKey}&Scene=${clientId2}&AppKey=${clientSecret2}&Token=${data.token}&Sig=${data.sig}&RemoteIp=192.168.0.1`
84
+ );
85
+ },
86
+ });
87
+ });
88
+ }
89
+ clearInterval(AWSCTimer);
90
+ }
91
+ }, 300);
92
+ break;
93
+ }
94
+ case "GEETEST": {
95
+ let getLock = false;
96
+ const gTimer = setInterval(() => {
97
+ if (!window.initGeetest4) {
98
+ loadScript("https://static.geetest.com/v4/gt4.js");
99
+ }
100
+ if (window.initGeetest4 && siteKey && !getLock) {
101
+ const captchaId = String(siteKey);
102
+ window.initGeetest4(
103
+ {
104
+ captchaId,
105
+ product: "float",
106
+ },
107
+ function (captchaObj) {
108
+ if (!getLock) {
109
+ captchaObj.appendTo("#captcha");
110
+ getLock = true;
111
+ }
112
+ captchaObj.onSuccess(function () {
113
+ const result = captchaObj.getValidate();
114
+ onChange(
115
+ `lot_number=${result.lot_number}&captcha_output=${result.captcha_output}&pass_token=${result.pass_token}&gen_time=${result.gen_time}&captcha_id=${siteKey}`
116
+ );
117
+ });
118
+ }
119
+ );
120
+ clearInterval(gTimer);
121
+ }
122
+ }, 500);
123
+ break;
124
+ }
125
+ case "Cloudflare Turnstile": {
126
+ const tTimer = setInterval(() => {
127
+ if (!window.turnstile) {
128
+ loadScript("https://challenges.cloudflare.com/turnstile/v0/api.js");
129
+ }
130
+ if (window.turnstile && window.turnstile.render) {
131
+ window.turnstile.render("#captcha", {
132
+ sitekey: siteKey,
133
+ callback: onChange,
134
+ });
135
+ clearInterval(tTimer);
136
+ }
137
+ }, 300);
138
+ break;
139
+ }
140
+ default:
141
+ break;
142
+ }
143
+ }, [captchaType, subType, siteKey, clientSecret, clientId2, clientSecret2]);
144
+
145
+ return <div id="captcha" />;
146
+ };