keycloakify 7.10.0 → 7.11.0
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/README.md +3 -3
- package/account/i18n/i18n.d.ts +4 -0
- package/account/i18n/i18n.js +6 -2
- package/account/i18n/i18n.js.map +1 -1
- package/account/pages/Password.js +69 -2
- package/account/pages/Password.js.map +1 -1
- package/package.json +1 -1
- package/src/account/i18n/i18n.tsx +6 -2
- package/src/account/pages/Password.tsx +113 -7
package/README.md
CHANGED
@@ -46,12 +46,12 @@ Their dedicated support helps us continue the development and maintenance of thi
|
|
46
46
|
|
47
47
|
[Cloud IAM](https://www.cloud-iam.com/) provides the following services:
|
48
48
|
|
49
|
-
-
|
49
|
+
- Simplify and secure your Keycloak Identity and Access Management. Keycloak as a Service.
|
50
50
|
- Custom theme building for your brand using Keycloakify.
|
51
51
|
|
52
52
|
<p align="center">
|
53
|
-
<a href="https://
|
54
|
-
<img src="https://user-images.githubusercontent.com/6702424/
|
53
|
+
<a href="https://cloud-iam.com/?mtm_campaign=keycloakify-deal&mtm_source=keycloakify-github">
|
54
|
+
<img src="https://user-images.githubusercontent.com/6702424/233476937-e37b1dc6-5a1c-4a0d-ba02-61c2ce62ffb6.png" alt="Cloud IAM Logo" width="350"/>
|
55
55
|
</a>
|
56
56
|
<br/>
|
57
57
|
<i>Use promo code <code>keycloakify5</code> </i>
|
package/account/i18n/i18n.d.ts
CHANGED
@@ -77,6 +77,8 @@ declare const keycloakifyExtraMessages: {
|
|
77
77
|
shouldMatchPattern: string;
|
78
78
|
mustBeAnInteger: string;
|
79
79
|
notAValidOption: string;
|
80
|
+
newPasswordSameAsOld: string;
|
81
|
+
passwordConfirmNotMatch: string;
|
80
82
|
};
|
81
83
|
fr: {
|
82
84
|
shouldBeEqual: string;
|
@@ -87,6 +89,8 @@ declare const keycloakifyExtraMessages: {
|
|
87
89
|
logoutConfirmTitle: string;
|
88
90
|
logoutConfirmHeader: string;
|
89
91
|
doLogout: string;
|
92
|
+
newPasswordSameAsOld: string;
|
93
|
+
passwordConfirmNotMatch: string;
|
90
94
|
};
|
91
95
|
};
|
92
96
|
export {};
|
package/account/i18n/i18n.js
CHANGED
@@ -91,7 +91,9 @@ const keycloakifyExtraMessages = {
|
|
91
91
|
"shouldBeDifferent": "{0} should be different to {1}",
|
92
92
|
"shouldMatchPattern": "Pattern should match: `/{0}/`",
|
93
93
|
"mustBeAnInteger": "Must be an integer",
|
94
|
-
"notAValidOption": "Not a valid option"
|
94
|
+
"notAValidOption": "Not a valid option",
|
95
|
+
"newPasswordSameAsOld": "New password must be different from the old one",
|
96
|
+
"passwordConfirmNotMatch": "Password confirmation does not match"
|
95
97
|
},
|
96
98
|
"fr": {
|
97
99
|
/* spell-checker: disable */
|
@@ -102,7 +104,9 @@ const keycloakifyExtraMessages = {
|
|
102
104
|
"notAValidOption": "N'est pas une option valide",
|
103
105
|
"logoutConfirmTitle": "Déconnexion",
|
104
106
|
"logoutConfirmHeader": "Êtes-vous sûr(e) de vouloir vous déconnecter ?",
|
105
|
-
"doLogout": "Se déconnecter"
|
107
|
+
"doLogout": "Se déconnecter",
|
108
|
+
"newPasswordSameAsOld": "Le nouveau mot de passe doit être différent de l'ancien",
|
109
|
+
"passwordConfirmNotMatch": "La confirmation du mot de passe ne correspond pas"
|
106
110
|
/* spell-checker: enable */
|
107
111
|
}
|
108
112
|
};
|
package/account/i18n/i18n.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/account/i18n/i18n.tsx"],"names":[],"mappings":";AAAA,OAAO,sCAAsC,CAAC;AAC9C,kIAAkI;AAClI,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,gBAAgB,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,M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K,EAAE,CAAW;KAC7G,CAAC;AACN,CAAC;AAED,MAAM,wBAAwB,GAAG;IAC7B,IAAI,EAAE;QACF,eAAe,EAAE,4BAA4B;QAC7C,mBAAmB,EAAE,gCAAgC;QACrD,oBAAoB,EAAE,+BAA+B;QACrD,iBAAiB,EAAE,oBAAoB;QACvC,iBAAiB,EAAE,oBAAoB;QACvC,sBAAsB,EAAE,iDAAiD;QACzE,yBAAyB,EAAE,sCAAsC;KACpE;IACD,IAAI,EAAE;QACF,4BAA4B;QAC5B,eAAe,EAAE,0BAA0B;QAC3C,mBAAmB,EAAE,gCAAgC;QACrD,oBAAoB,EAAE,mCAAmC;QACzD,iBAAiB,EAAE,4BAA4B;QAC/C,iBAAiB,EAAE,6BAA6B;QAEhD,oBAAoB,EAAE,aAAa;QACnC,qBAAqB,EAAE,gDAAgD;QACvE,UAAU,EAAE,gBAAgB;QAC5B,sBAAsB,EAAE,yDAAyD;QACjF,yBAAyB,EAAE,mDAAmD;QAC9E,2BAA2B;KAC9B;CACJ,CAAC"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { useState } from "react";
|
2
3
|
import { clsx } from "../../tools/clsx";
|
3
4
|
import { useGetClassName } from "../../account/lib/useGetClassName";
|
4
5
|
export default function Password(props) {
|
@@ -9,7 +10,73 @@ export default function Password(props) {
|
|
9
10
|
"classes": Object.assign(Object.assign({}, classes), { "kcBodyClass": clsx(classes === null || classes === void 0 ? void 0 : classes.kcBodyClass, "password") })
|
10
11
|
});
|
11
12
|
const { url, password, account, stateChecker } = kcContext;
|
12
|
-
const { msg } = i18n;
|
13
|
-
|
13
|
+
const { msgStr, msg } = i18n;
|
14
|
+
const [currentPassword, setCurrentPassword] = useState("");
|
15
|
+
const [newPassword, setNewPassword] = useState("");
|
16
|
+
const [newPasswordConfirm, setNewPasswordConfirm] = useState("");
|
17
|
+
const [newPasswordError, setNewPasswordError] = useState("");
|
18
|
+
const [newPasswordConfirmError, setNewPasswordConfirmError] = useState("");
|
19
|
+
const [hasNewPasswordBlurred, setHasNewPasswordBlurred] = useState(false);
|
20
|
+
const [hasNewPasswordConfirmBlurred, setHasNewPasswordConfirmBlurred] = useState(false);
|
21
|
+
const checkNewPassword = (newPassword) => {
|
22
|
+
if (!password.passwordSet) {
|
23
|
+
return;
|
24
|
+
}
|
25
|
+
if (newPassword === currentPassword) {
|
26
|
+
setNewPasswordError(msgStr("newPasswordSameAsOld"));
|
27
|
+
}
|
28
|
+
else {
|
29
|
+
setNewPasswordError("");
|
30
|
+
}
|
31
|
+
};
|
32
|
+
const checkNewPasswordConfirm = (newPasswordConfirm) => {
|
33
|
+
if (newPasswordConfirm === "") {
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
if (newPassword !== newPasswordConfirm) {
|
37
|
+
setNewPasswordConfirmError(msgStr("passwordConfirmNotMatch"));
|
38
|
+
}
|
39
|
+
else {
|
40
|
+
setNewPasswordConfirmError("");
|
41
|
+
}
|
42
|
+
};
|
43
|
+
return (_jsxs(Template, Object.assign({}, {
|
44
|
+
kcContext: Object.assign(Object.assign({}, kcContext), { "message": (() => {
|
45
|
+
if (newPasswordError !== "") {
|
46
|
+
return {
|
47
|
+
"type": "error",
|
48
|
+
"summary": newPasswordError
|
49
|
+
};
|
50
|
+
}
|
51
|
+
if (newPasswordConfirmError !== "") {
|
52
|
+
return {
|
53
|
+
"type": "error",
|
54
|
+
"summary": newPasswordConfirmError
|
55
|
+
};
|
56
|
+
}
|
57
|
+
return kcContext.message;
|
58
|
+
})() }),
|
59
|
+
i18n,
|
60
|
+
doUseDefaultCss,
|
61
|
+
classes
|
62
|
+
}, { active: "password" }, { children: [_jsxs("div", Object.assign({ className: "row" }, { children: [_jsx("div", Object.assign({ className: "col-md-10" }, { children: _jsx("h2", { children: msg("changePasswordHtmlTitle") }) })), _jsx("div", Object.assign({ className: "col-md-2 subtitle" }, { children: _jsx("span", Object.assign({ className: "subtitle" }, { children: msg("allFieldsRequired") })) }))] })), _jsxs("form", Object.assign({ action: url.passwordUrl, className: "form-horizontal", method: "post" }, { children: [_jsx("input", { type: "text", id: "username", name: "username", value: (_a = account.username) !== null && _a !== void 0 ? _a : "", autoComplete: "username", readOnly: true, style: { "display": "none" } }), password.passwordSet && (_jsxs("div", Object.assign({ className: "form-group" }, { children: [_jsx("div", Object.assign({ className: "col-sm-2 col-md-2" }, { children: _jsx("label", Object.assign({ htmlFor: "password", className: "control-label" }, { children: msg("password") })) })), _jsx("div", Object.assign({ className: "col-sm-10 col-md-10" }, { children: _jsx("input", { type: "password", className: "form-control", id: "password", name: "password", autoFocus: true, autoComplete: "current-password", value: currentPassword, onChange: event => setCurrentPassword(event.target.value) }) }))] }))), _jsx("input", { type: "hidden", id: "stateChecker", name: "stateChecker", value: stateChecker }), _jsxs("div", Object.assign({ className: "form-group" }, { children: [_jsx("div", Object.assign({ className: "col-sm-2 col-md-2" }, { children: _jsx("label", Object.assign({ htmlFor: "password-new", className: "control-label" }, { children: msg("passwordNew") })) })), _jsx("div", Object.assign({ className: "col-sm-10 col-md-10" }, { children: _jsx("input", { type: "password", className: "form-control", id: "password-new", name: "password-new", autoComplete: "new-password", value: newPassword, onChange: event => {
|
63
|
+
const newPassword = event.target.value;
|
64
|
+
setNewPassword(newPassword);
|
65
|
+
if (hasNewPasswordBlurred) {
|
66
|
+
checkNewPassword(newPassword);
|
67
|
+
}
|
68
|
+
}, onBlur: () => {
|
69
|
+
setHasNewPasswordBlurred(true);
|
70
|
+
checkNewPassword(newPassword);
|
71
|
+
} }) }))] })), _jsxs("div", Object.assign({ className: "form-group" }, { children: [_jsx("div", Object.assign({ className: "col-sm-2 col-md-2" }, { children: _jsx("label", Object.assign({ htmlFor: "password-confirm", className: "control-label two-lines" }, { children: msg("passwordConfirm") })) })), _jsx("div", Object.assign({ className: "col-sm-10 col-md-10" }, { children: _jsx("input", { type: "password", className: "form-control", id: "password-confirm", name: "password-confirm", autoComplete: "new-password", value: newPasswordConfirm, onChange: event => {
|
72
|
+
const newPasswordConfirm = event.target.value;
|
73
|
+
setNewPasswordConfirm(newPasswordConfirm);
|
74
|
+
if (hasNewPasswordConfirmBlurred) {
|
75
|
+
checkNewPasswordConfirm(newPasswordConfirm);
|
76
|
+
}
|
77
|
+
}, onBlur: () => {
|
78
|
+
setHasNewPasswordConfirmBlurred(true);
|
79
|
+
checkNewPasswordConfirm(newPasswordConfirm);
|
80
|
+
} }) }))] })), _jsx("div", Object.assign({ className: "form-group" }, { children: _jsx("div", Object.assign({ id: "kc-form-buttons", className: "col-md-offset-2 col-md-10 submit" }, { children: _jsx("div", { children: _jsx("button", Object.assign({ disabled: newPasswordError !== "" || newPasswordConfirmError !== "", type: "submit", className: clsx(getClassName("kcButtonClass"), getClassName("kcButtonPrimaryClass"), getClassName("kcButtonLargeClass")), name: "submitAction", value: "Save" }, { children: msg("doSave") })) }) })) }))] }))] })));
|
14
81
|
}
|
15
82
|
//# sourceMappingURL=Password.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Password.js","sourceRoot":"","sources":["../../src/account/pages/Password.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAI1E,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAsE;;IACnG,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAEtE,MAAM,EAAE,YAAY,EAAE,GAAG,eAAe,CAAC;QACrC,eAAe;QACf,SAAS,kCACF,OAAO,KACV,aAAa,EAAE,IAAI,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAE,UAAU,CAAC,GACxD;KACJ,CAAC,CAAC;IAEH,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,GA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+BAA+B,CAAC,IAAI,CAAC,CAAC;wCACtC,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;oCAChD,CAAC,GACH,IACA,KACJ,EAEN,4BAAK,SAAS,EAAC,YAAY,gBACvB,4BAAK,EAAE,EAAC,iBAAiB,EAAC,SAAS,EAAC,kCAAkC,gBAClE,wBACI,+BACI,QAAQ,EAAE,gBAAgB,KAAK,EAAE,IAAI,uBAAuB,KAAK,EAAE,EACnE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,IAAI,CACX,YAAY,CAAC,eAAe,CAAC,EAC7B,YAAY,CAAC,sBAAsB,CAAC,EACpC,YAAY,CAAC,oBAAoB,CAAC,CACrC,EACD,IAAI,EAAC,cAAc,EACnB,KAAK,EAAC,MAAM,gBAEX,GAAG,CAAC,QAAQ,CAAC,IACT,GACP,IACJ,IACJ,KACH,KACA,CACd,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
@@ -211,7 +211,9 @@ const keycloakifyExtraMessages = {
|
|
211
211
|
"shouldBeDifferent": "{0} should be different to {1}",
|
212
212
|
"shouldMatchPattern": "Pattern should match: `/{0}/`",
|
213
213
|
"mustBeAnInteger": "Must be an integer",
|
214
|
-
"notAValidOption": "Not a valid option"
|
214
|
+
"notAValidOption": "Not a valid option",
|
215
|
+
"newPasswordSameAsOld": "New password must be different from the old one",
|
216
|
+
"passwordConfirmNotMatch": "Password confirmation does not match"
|
215
217
|
},
|
216
218
|
"fr": {
|
217
219
|
/* spell-checker: disable */
|
@@ -223,7 +225,9 @@ const keycloakifyExtraMessages = {
|
|
223
225
|
|
224
226
|
"logoutConfirmTitle": "Déconnexion",
|
225
227
|
"logoutConfirmHeader": "Êtes-vous sûr(e) de vouloir vous déconnecter ?",
|
226
|
-
"doLogout": "Se déconnecter"
|
228
|
+
"doLogout": "Se déconnecter",
|
229
|
+
"newPasswordSameAsOld": "Le nouveau mot de passe doit être différent de l'ancien",
|
230
|
+
"passwordConfirmNotMatch": "La confirmation du mot de passe ne correspond pas"
|
227
231
|
/* spell-checker: enable */
|
228
232
|
}
|
229
233
|
};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { useState } from "react";
|
1
2
|
import { clsx } from "keycloakify/tools/clsx";
|
2
3
|
import type { PageProps } from "keycloakify/account/pages/PageProps";
|
3
4
|
import { useGetClassName } from "keycloakify/account/lib/useGetClassName";
|
@@ -17,10 +18,69 @@ export default function Password(props: PageProps<Extract<KcContext, { pageId: "
|
|
17
18
|
|
18
19
|
const { url, password, account, stateChecker } = kcContext;
|
19
20
|
|
20
|
-
const { msg } = i18n;
|
21
|
+
const { msgStr, msg } = i18n;
|
22
|
+
|
23
|
+
const [currentPassword, setCurrentPassword] = useState("");
|
24
|
+
const [newPassword, setNewPassword] = useState("");
|
25
|
+
const [newPasswordConfirm, setNewPasswordConfirm] = useState("");
|
26
|
+
const [newPasswordError, setNewPasswordError] = useState("");
|
27
|
+
const [newPasswordConfirmError, setNewPasswordConfirmError] = useState("");
|
28
|
+
const [hasNewPasswordBlurred, setHasNewPasswordBlurred] = useState(false);
|
29
|
+
const [hasNewPasswordConfirmBlurred, setHasNewPasswordConfirmBlurred] = useState(false);
|
30
|
+
|
31
|
+
const checkNewPassword = (newPassword: string) => {
|
32
|
+
if (!password.passwordSet) {
|
33
|
+
return;
|
34
|
+
}
|
35
|
+
|
36
|
+
if (newPassword === currentPassword) {
|
37
|
+
setNewPasswordError(msgStr("newPasswordSameAsOld"));
|
38
|
+
} else {
|
39
|
+
setNewPasswordError("");
|
40
|
+
}
|
41
|
+
};
|
42
|
+
|
43
|
+
const checkNewPasswordConfirm = (newPasswordConfirm: string) => {
|
44
|
+
if (newPasswordConfirm === "") {
|
45
|
+
return;
|
46
|
+
}
|
47
|
+
|
48
|
+
if (newPassword !== newPasswordConfirm) {
|
49
|
+
setNewPasswordConfirmError(msgStr("passwordConfirmNotMatch"));
|
50
|
+
} else {
|
51
|
+
setNewPasswordConfirmError("");
|
52
|
+
}
|
53
|
+
};
|
21
54
|
|
22
55
|
return (
|
23
|
-
<Template
|
56
|
+
<Template
|
57
|
+
{...{
|
58
|
+
kcContext: {
|
59
|
+
...kcContext,
|
60
|
+
"message": (() => {
|
61
|
+
if (newPasswordError !== "") {
|
62
|
+
return {
|
63
|
+
"type": "error",
|
64
|
+
"summary": newPasswordError
|
65
|
+
};
|
66
|
+
}
|
67
|
+
|
68
|
+
if (newPasswordConfirmError !== "") {
|
69
|
+
return {
|
70
|
+
"type": "error",
|
71
|
+
"summary": newPasswordConfirmError
|
72
|
+
};
|
73
|
+
}
|
74
|
+
|
75
|
+
return kcContext.message;
|
76
|
+
})()
|
77
|
+
},
|
78
|
+
i18n,
|
79
|
+
doUseDefaultCss,
|
80
|
+
classes
|
81
|
+
}}
|
82
|
+
active="password"
|
83
|
+
>
|
24
84
|
<div className="row">
|
25
85
|
<div className="col-md-10">
|
26
86
|
<h2>{msg("changePasswordHtmlTitle")}</h2>
|
@@ -48,9 +108,17 @@ export default function Password(props: PageProps<Extract<KcContext, { pageId: "
|
|
48
108
|
{msg("password")}
|
49
109
|
</label>
|
50
110
|
</div>
|
51
|
-
|
52
111
|
<div className="col-sm-10 col-md-10">
|
53
|
-
<input
|
112
|
+
<input
|
113
|
+
type="password"
|
114
|
+
className="form-control"
|
115
|
+
id="password"
|
116
|
+
name="password"
|
117
|
+
autoFocus
|
118
|
+
autoComplete="current-password"
|
119
|
+
value={currentPassword}
|
120
|
+
onChange={event => setCurrentPassword(event.target.value)}
|
121
|
+
/>
|
54
122
|
</div>
|
55
123
|
</div>
|
56
124
|
)}
|
@@ -63,9 +131,27 @@ export default function Password(props: PageProps<Extract<KcContext, { pageId: "
|
|
63
131
|
{msg("passwordNew")}
|
64
132
|
</label>
|
65
133
|
</div>
|
66
|
-
|
67
134
|
<div className="col-sm-10 col-md-10">
|
68
|
-
<input
|
135
|
+
<input
|
136
|
+
type="password"
|
137
|
+
className="form-control"
|
138
|
+
id="password-new"
|
139
|
+
name="password-new"
|
140
|
+
autoComplete="new-password"
|
141
|
+
value={newPassword}
|
142
|
+
onChange={event => {
|
143
|
+
const newPassword = event.target.value;
|
144
|
+
|
145
|
+
setNewPassword(newPassword);
|
146
|
+
if (hasNewPasswordBlurred) {
|
147
|
+
checkNewPassword(newPassword);
|
148
|
+
}
|
149
|
+
}}
|
150
|
+
onBlur={() => {
|
151
|
+
setHasNewPasswordBlurred(true);
|
152
|
+
checkNewPassword(newPassword);
|
153
|
+
}}
|
154
|
+
/>
|
69
155
|
</div>
|
70
156
|
</div>
|
71
157
|
|
@@ -77,7 +163,26 @@ export default function Password(props: PageProps<Extract<KcContext, { pageId: "
|
|
77
163
|
</div>
|
78
164
|
|
79
165
|
<div className="col-sm-10 col-md-10">
|
80
|
-
<input
|
166
|
+
<input
|
167
|
+
type="password"
|
168
|
+
className="form-control"
|
169
|
+
id="password-confirm"
|
170
|
+
name="password-confirm"
|
171
|
+
autoComplete="new-password"
|
172
|
+
value={newPasswordConfirm}
|
173
|
+
onChange={event => {
|
174
|
+
const newPasswordConfirm = event.target.value;
|
175
|
+
|
176
|
+
setNewPasswordConfirm(newPasswordConfirm);
|
177
|
+
if (hasNewPasswordConfirmBlurred) {
|
178
|
+
checkNewPasswordConfirm(newPasswordConfirm);
|
179
|
+
}
|
180
|
+
}}
|
181
|
+
onBlur={() => {
|
182
|
+
setHasNewPasswordConfirmBlurred(true);
|
183
|
+
checkNewPasswordConfirm(newPasswordConfirm);
|
184
|
+
}}
|
185
|
+
/>
|
81
186
|
</div>
|
82
187
|
</div>
|
83
188
|
|
@@ -85,6 +190,7 @@ export default function Password(props: PageProps<Extract<KcContext, { pageId: "
|
|
85
190
|
<div id="kc-form-buttons" className="col-md-offset-2 col-md-10 submit">
|
86
191
|
<div>
|
87
192
|
<button
|
193
|
+
disabled={newPasswordError !== "" || newPasswordConfirmError !== ""}
|
88
194
|
type="submit"
|
89
195
|
className={clsx(
|
90
196
|
getClassName("kcButtonClass"),
|