keycloakify 6.7.1 → 6.8.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.
Files changed (92) hide show
  1. package/README.md +6 -0
  2. package/bin/tsconfig.tsbuildinfo +1 -1
  3. package/lib/components/Error.d.ts +6 -3
  4. package/lib/components/Error.js +4 -4
  5. package/lib/components/Error.js.map +1 -1
  6. package/lib/components/IdpReviewUserProfile.d.ts +6 -3
  7. package/lib/components/IdpReviewUserProfile.js +10 -10
  8. package/lib/components/IdpReviewUserProfile.js.map +1 -1
  9. package/lib/components/Info.d.ts +6 -3
  10. package/lib/components/Info.js +4 -4
  11. package/lib/components/Info.js.map +1 -1
  12. package/lib/components/KcApp.d.ts +7 -4
  13. package/lib/components/KcApp.js +25 -24
  14. package/lib/components/KcApp.js.map +1 -1
  15. package/lib/components/Login.d.ts +6 -3
  16. package/lib/components/Login.js +17 -17
  17. package/lib/components/Login.js.map +1 -1
  18. package/lib/components/LoginConfigTotp.d.ts +6 -3
  19. package/lib/components/LoginConfigTotp.js +25 -25
  20. package/lib/components/LoginConfigTotp.js.map +1 -1
  21. package/lib/components/LoginIdpLinkConfirm.d.ts +6 -3
  22. package/lib/components/LoginIdpLinkConfirm.js +7 -7
  23. package/lib/components/LoginIdpLinkConfirm.js.map +1 -1
  24. package/lib/components/LoginIdpLinkEmail.d.ts +6 -3
  25. package/lib/components/LoginIdpLinkEmail.js +4 -4
  26. package/lib/components/LoginIdpLinkEmail.js.map +1 -1
  27. package/lib/components/LoginOtp.d.ts +6 -3
  28. package/lib/components/LoginOtp.js +19 -19
  29. package/lib/components/LoginOtp.js.map +1 -1
  30. package/lib/components/LoginPageExpired.d.ts +6 -3
  31. package/lib/components/LoginPageExpired.js +4 -4
  32. package/lib/components/LoginPageExpired.js.map +1 -1
  33. package/lib/components/LoginPassword.d.ts +6 -3
  34. package/lib/components/LoginPassword.js +12 -12
  35. package/lib/components/LoginPassword.js.map +1 -1
  36. package/lib/components/LoginResetPassword.d.ts +6 -3
  37. package/lib/components/LoginResetPassword.js +14 -14
  38. package/lib/components/LoginResetPassword.js.map +1 -1
  39. package/lib/components/LoginUpdatePassword.d.ts +6 -3
  40. package/lib/components/LoginUpdatePassword.js +20 -20
  41. package/lib/components/LoginUpdatePassword.js.map +1 -1
  42. package/lib/components/LoginUpdateProfile.d.ts +6 -3
  43. package/lib/components/LoginUpdateProfile.js +31 -31
  44. package/lib/components/LoginUpdateProfile.js.map +1 -1
  45. package/lib/components/LoginUsername.d.ts +6 -3
  46. package/lib/components/LoginUsername.js +13 -13
  47. package/lib/components/LoginUsername.js.map +1 -1
  48. package/lib/components/LoginVerifyEmail.d.ts +6 -3
  49. package/lib/components/LoginVerifyEmail.js +4 -4
  50. package/lib/components/LoginVerifyEmail.js.map +1 -1
  51. package/lib/components/LogoutConfirm.d.ts +6 -3
  52. package/lib/components/LogoutConfirm.js +8 -8
  53. package/lib/components/LogoutConfirm.js.map +1 -1
  54. package/lib/components/Register.d.ts +6 -3
  55. package/lib/components/Register.js +41 -41
  56. package/lib/components/Register.js.map +1 -1
  57. package/lib/components/RegisterUserProfile.d.ts +6 -3
  58. package/lib/components/RegisterUserProfile.js +12 -12
  59. package/lib/components/RegisterUserProfile.js.map +1 -1
  60. package/lib/components/Terms.d.ts +6 -3
  61. package/lib/components/Terms.js +6 -6
  62. package/lib/components/Terms.js.map +1 -1
  63. package/lib/components/UpdateUserProfile.d.ts +6 -3
  64. package/lib/components/UpdateUserProfile.js +11 -11
  65. package/lib/components/UpdateUserProfile.js.map +1 -1
  66. package/lib/components/WebauthnAuthenticate.d.ts +6 -3
  67. package/lib/components/WebauthnAuthenticate.js +18 -18
  68. package/lib/components/WebauthnAuthenticate.js.map +1 -1
  69. package/lib/tsconfig.tsbuildinfo +1 -1
  70. package/package.json +3 -3
  71. package/src/lib/components/Error.tsx +34 -31
  72. package/src/lib/components/IdpReviewUserProfile.tsx +50 -47
  73. package/src/lib/components/Info.tsx +49 -46
  74. package/src/lib/components/KcApp.tsx +74 -69
  75. package/src/lib/components/Login.tsx +178 -175
  76. package/src/lib/components/LoginConfigTotp.tsx +163 -160
  77. package/src/lib/components/LoginIdpLinkConfirm.tsx +56 -43
  78. package/src/lib/components/LoginIdpLinkEmail.tsx +34 -31
  79. package/src/lib/components/LoginOtp.tsx +86 -83
  80. package/src/lib/components/LoginPageExpired.tsx +38 -35
  81. package/src/lib/components/LoginPassword.tsx +79 -76
  82. package/src/lib/components/LoginResetPassword.tsx +67 -64
  83. package/src/lib/components/LoginUpdatePassword.tsx +105 -102
  84. package/src/lib/components/LoginUpdateProfile.tsx +108 -105
  85. package/src/lib/components/LoginUsername.tsx +145 -142
  86. package/src/lib/components/LoginVerifyEmail.tsx +34 -31
  87. package/src/lib/components/LogoutConfirm.tsx +57 -54
  88. package/src/lib/components/Register.tsx +137 -134
  89. package/src/lib/components/RegisterUserProfile.tsx +63 -60
  90. package/src/lib/components/Terms.tsx +56 -52
  91. package/src/lib/components/UpdateUserProfile.tsx +61 -58
  92. package/src/lib/components/WebauthnAuthenticate.tsx +179 -178
@@ -1,77 +1,80 @@
1
1
  import React, { useState, memo } from "react";
2
- import Template from "./Template";
2
+ import DefaultTemplate from "./Template";
3
+ import type { TemplateProps } from "./Template";
3
4
  import type { KcProps } from "./KcProps";
4
5
  import type { KcContextBase } from "../getKcContext/KcContextBase";
5
6
  import { useCssAndCx } from "../tools/useCssAndCx";
6
7
  import type { I18n } from "../i18n";
7
8
  import { UserProfileFormFields } from "./shared/UserProfileCommons";
8
9
 
9
- const UpdateUserProfile = memo(
10
- ({
11
- kcContext,
12
- i18n,
13
- doFetchDefaultThemeResources = true,
14
- ...props
15
- }: { kcContext: KcContextBase.UpdateUserProfile; i18n: I18n; doFetchDefaultThemeResources?: boolean } & KcProps) => {
16
- const { cx } = useCssAndCx();
10
+ export type UpdateUserProfileProps = KcProps & {
11
+ kcContext: KcContextBase.UpdateUserProfile;
12
+ i18n: I18n;
13
+ doFetchDefaultThemeResources?: boolean;
14
+ Template?: (props: TemplateProps) => JSX.Element | null;
15
+ };
17
16
 
18
- const { msg, msgStr } = i18n;
17
+ const UpdateUserProfile = memo((props: UpdateUserProfileProps) => {
18
+ const { kcContext, i18n, doFetchDefaultThemeResources = true, Template = DefaultTemplate, ...kcProps } = props;
19
19
 
20
- const { url, isAppInitiatedAction } = kcContext;
20
+ const { cx } = useCssAndCx();
21
21
 
22
- const [isFomSubmittable, setIsFomSubmittable] = useState(false);
22
+ const { msg, msgStr } = i18n;
23
23
 
24
- return (
25
- <Template
26
- {...{ kcContext, i18n, doFetchDefaultThemeResources, ...props }}
27
- headerNode={msg("loginProfileTitle")}
28
- formNode={
29
- <form id="kc-update-profile-form" className={cx(props.kcFormClass)} action={url.loginAction} method="post">
30
- <UserProfileFormFields kcContext={kcContext} onIsFormSubmittableValueChange={setIsFomSubmittable} i18n={i18n} {...props} />
24
+ const { url, isAppInitiatedAction } = kcContext;
31
25
 
32
- <div className={cx(props.kcFormGroupClass)}>
33
- <div id="kc-form-options" className={cx(props.kcFormOptionsClass)}>
34
- <div className={cx(props.kcFormOptionsWrapperClass)}></div>
35
- </div>
26
+ const [isFomSubmittable, setIsFomSubmittable] = useState(false);
36
27
 
37
- <div id="kc-form-buttons" className={cx(props.kcFormButtonsClass)}>
38
- {isAppInitiatedAction ? (
39
- <>
40
- <input
41
- className={cx(props.kcButtonClass, props.kcButtonPrimaryClass, props.kcButtonLargeClass)}
42
- type="submit"
43
- value={msgStr("doSubmit")}
44
- />
45
- <button
46
- className={cx(props.kcButtonClass, props.kcButtonDefaultClass, props.kcButtonLargeClass)}
47
- type="submit"
48
- name="cancel-aia"
49
- value="true"
50
- formNoValidate
51
- >
52
- {msg("doCancel")}
53
- </button>
54
- </>
55
- ) : (
28
+ return (
29
+ <Template
30
+ {...{ kcContext, i18n, doFetchDefaultThemeResources, ...kcProps }}
31
+ headerNode={msg("loginProfileTitle")}
32
+ formNode={
33
+ <form id="kc-update-profile-form" className={cx(kcProps.kcFormClass)} action={url.loginAction} method="post">
34
+ <UserProfileFormFields kcContext={kcContext} onIsFormSubmittableValueChange={setIsFomSubmittable} i18n={i18n} {...kcProps} />
35
+
36
+ <div className={cx(kcProps.kcFormGroupClass)}>
37
+ <div id="kc-form-options" className={cx(kcProps.kcFormOptionsClass)}>
38
+ <div className={cx(kcProps.kcFormOptionsWrapperClass)}></div>
39
+ </div>
40
+
41
+ <div id="kc-form-buttons" className={cx(kcProps.kcFormButtonsClass)}>
42
+ {isAppInitiatedAction ? (
43
+ <>
56
44
  <input
57
- className={cx(
58
- props.kcButtonClass,
59
- props.kcButtonPrimaryClass,
60
- props.kcButtonBlockClass,
61
- props.kcButtonLargeClass
62
- )}
45
+ className={cx(kcProps.kcButtonClass, kcProps.kcButtonPrimaryClass, kcProps.kcButtonLargeClass)}
63
46
  type="submit"
64
- defaultValue={msgStr("doSubmit")}
65
- disabled={!isFomSubmittable}
47
+ value={msgStr("doSubmit")}
66
48
  />
67
- )}
68
- </div>
49
+ <button
50
+ className={cx(kcProps.kcButtonClass, kcProps.kcButtonDefaultClass, kcProps.kcButtonLargeClass)}
51
+ type="submit"
52
+ name="cancel-aia"
53
+ value="true"
54
+ formNoValidate
55
+ >
56
+ {msg("doCancel")}
57
+ </button>
58
+ </>
59
+ ) : (
60
+ <input
61
+ className={cx(
62
+ kcProps.kcButtonClass,
63
+ kcProps.kcButtonPrimaryClass,
64
+ kcProps.kcButtonBlockClass,
65
+ kcProps.kcButtonLargeClass
66
+ )}
67
+ type="submit"
68
+ defaultValue={msgStr("doSubmit")}
69
+ disabled={!isFomSubmittable}
70
+ />
71
+ )}
69
72
  </div>
70
- </form>
71
- }
72
- />
73
- );
74
- }
75
- );
73
+ </div>
74
+ </form>
75
+ }
76
+ />
77
+ );
78
+ });
76
79
 
77
80
  export default UpdateUserProfile;
@@ -1,5 +1,6 @@
1
1
  import React, { useRef, useState, memo } from "react";
2
- import Template from "./Template";
2
+ import DefaultTemplate from "./Template";
3
+ import type { TemplateProps } from "./Template";
3
4
  import type { KcProps } from "./KcProps";
4
5
  import type { KcContextBase } from "../getKcContext/KcContextBase";
5
6
  import { useCssAndCx } from "../tools/useCssAndCx";
@@ -7,198 +8,198 @@ import type { I18n, MessageKeyBase } from "../i18n";
7
8
  import { base64url } from "rfc4648";
8
9
  import { useConstCallback } from "powerhooks/useConstCallback";
9
10
 
10
- const WebauthnAuthenticate = memo(
11
- ({
12
- kcContext,
13
- i18n,
14
- doFetchDefaultThemeResources = true,
15
- ...props
16
- }: { kcContext: KcContextBase.WebauthnAuthenticate; i18n: I18n; doFetchDefaultThemeResources?: boolean } & KcProps) => {
17
- const { url } = kcContext;
11
+ export type WebauthnAuthenticateProps = KcProps & {
12
+ kcContext: KcContextBase.WebauthnAuthenticate;
13
+ i18n: I18n;
14
+ doFetchDefaultThemeResources?: boolean;
15
+ Template?: (props: TemplateProps) => JSX.Element | null;
16
+ };
18
17
 
19
- const { msg, msgStr } = i18n;
18
+ const WebauthnAuthenticate = memo((props: WebauthnAuthenticateProps) => {
19
+ const { kcContext, i18n, doFetchDefaultThemeResources = true, Template = DefaultTemplate, ...kcProps } = props;
20
20
 
21
- const { authenticators, challenge, shouldDisplayAuthenticators, userVerification, rpId } = kcContext;
22
- const createTimeout = Number(kcContext.createTimeout);
23
- const isUserIdentified = kcContext.isUserIdentified == "true";
21
+ const { url } = kcContext;
24
22
 
25
- const { cx } = useCssAndCx();
23
+ const { msg, msgStr } = i18n;
26
24
 
27
- const webAuthnAuthenticate = useConstCallback(async () => {
28
- if (!isUserIdentified) {
29
- return;
30
- }
31
- const allowCredentials = authenticators.authenticators.map(
32
- authenticator =>
33
- ({
34
- id: base64url.parse(authenticator.credentialId, { loose: true }),
35
- type: "public-key"
36
- } as PublicKeyCredentialDescriptor)
37
- );
38
- // Check if WebAuthn is supported by this browser
39
- if (!window.PublicKeyCredential) {
40
- setError(msgStr("webauthn-unsupported-browser-text"));
41
- submitForm();
42
- return;
43
- }
44
-
45
- const publicKey: PublicKeyCredentialRequestOptions = {
46
- rpId,
47
- challenge: base64url.parse(challenge, { loose: true })
48
- };
49
-
50
- if (createTimeout !== 0) {
51
- publicKey.timeout = createTimeout * 1000;
52
- }
53
-
54
- if (allowCredentials.length) {
55
- publicKey.allowCredentials = allowCredentials;
56
- }
25
+ const { authenticators, challenge, shouldDisplayAuthenticators, userVerification, rpId } = kcContext;
26
+ const createTimeout = Number(kcContext.createTimeout);
27
+ const isUserIdentified = kcContext.isUserIdentified == "true";
57
28
 
58
- if (userVerification !== "not specified") {
59
- publicKey.userVerification = userVerification;
60
- }
29
+ const { cx } = useCssAndCx();
61
30
 
62
- try {
63
- const resultRaw = await navigator.credentials.get({ publicKey });
64
- if (!resultRaw || resultRaw.type != "public-key") return;
65
- const result = resultRaw as PublicKeyCredential;
66
- if (!("authenticatorData" in result.response)) return;
67
- const response = result.response as AuthenticatorAssertionResponse;
68
- const clientDataJSON = response.clientDataJSON;
69
- const authenticatorData = response.authenticatorData;
70
- const signature = response.signature;
71
-
72
- setClientDataJSON(base64url.stringify(new Uint8Array(clientDataJSON), { pad: false }));
73
- setAuthenticatorData(base64url.stringify(new Uint8Array(authenticatorData), { pad: false }));
74
- setSignature(base64url.stringify(new Uint8Array(signature), { pad: false }));
75
- setCredentialId(result.id);
76
- setUserHandle(base64url.stringify(new Uint8Array(response.userHandle!), { pad: false }));
77
- submitForm();
78
- } catch (err) {
79
- setError(String(err));
80
- submitForm();
81
- }
82
- });
83
-
84
- const webAuthForm = useRef<HTMLFormElement>(null);
85
- const submitForm = useConstCallback(() => {
86
- webAuthForm.current!.submit();
87
- });
88
-
89
- const [clientDataJSON, setClientDataJSON] = useState("");
90
- const [authenticatorData, setAuthenticatorData] = useState("");
91
- const [signature, setSignature] = useState("");
92
- const [credentialId, setCredentialId] = useState("");
93
- const [userHandle, setUserHandle] = useState("");
94
- const [error, setError] = useState("");
95
-
96
- return (
97
- <Template
98
- {...{ kcContext, i18n, doFetchDefaultThemeResources, ...props }}
99
- headerNode={msg("webauthn-login-title")}
100
- formNode={
101
- <div id="kc-form-webauthn" className={cx(props.kcFormClass)}>
102
- <form id="webauth" action={url.loginAction} ref={webAuthForm} method="post">
103
- <input type="hidden" id="clientDataJSON" name="clientDataJSON" value={clientDataJSON} />
104
- <input type="hidden" id="authenticatorData" name="authenticatorData" value={authenticatorData} />
105
- <input type="hidden" id="signature" name="signature" value={signature} />
106
- <input type="hidden" id="credentialId" name="credentialId" value={credentialId} />
107
- <input type="hidden" id="userHandle" name="userHandle" value={userHandle} />
108
- <input type="hidden" id="error" name="error" value={error} />
109
- </form>
110
- <div className={cx(props.kcFormGroupClass)}>
111
- {authenticators &&
112
- (() => (
113
- <form id="authn_select" className={cx(props.kcFormClass)}>
31
+ const webAuthnAuthenticate = useConstCallback(async () => {
32
+ if (!isUserIdentified) {
33
+ return;
34
+ }
35
+ const allowCredentials = authenticators.authenticators.map(
36
+ authenticator =>
37
+ ({
38
+ id: base64url.parse(authenticator.credentialId, { loose: true }),
39
+ type: "public-key"
40
+ } as PublicKeyCredentialDescriptor)
41
+ );
42
+ // Check if WebAuthn is supported by this browser
43
+ if (!window.PublicKeyCredential) {
44
+ setError(msgStr("webauthn-unsupported-browser-text"));
45
+ submitForm();
46
+ return;
47
+ }
48
+
49
+ const publicKey: PublicKeyCredentialRequestOptions = {
50
+ rpId,
51
+ challenge: base64url.parse(challenge, { loose: true })
52
+ };
53
+
54
+ if (createTimeout !== 0) {
55
+ publicKey.timeout = createTimeout * 1000;
56
+ }
57
+
58
+ if (allowCredentials.length) {
59
+ publicKey.allowCredentials = allowCredentials;
60
+ }
61
+
62
+ if (userVerification !== "not specified") {
63
+ publicKey.userVerification = userVerification;
64
+ }
65
+
66
+ try {
67
+ const resultRaw = await navigator.credentials.get({ publicKey });
68
+ if (!resultRaw || resultRaw.type != "public-key") return;
69
+ const result = resultRaw as PublicKeyCredential;
70
+ if (!("authenticatorData" in result.response)) return;
71
+ const response = result.response as AuthenticatorAssertionResponse;
72
+ const clientDataJSON = response.clientDataJSON;
73
+ const authenticatorData = response.authenticatorData;
74
+ const signature = response.signature;
75
+
76
+ setClientDataJSON(base64url.stringify(new Uint8Array(clientDataJSON), { pad: false }));
77
+ setAuthenticatorData(base64url.stringify(new Uint8Array(authenticatorData), { pad: false }));
78
+ setSignature(base64url.stringify(new Uint8Array(signature), { pad: false }));
79
+ setCredentialId(result.id);
80
+ setUserHandle(base64url.stringify(new Uint8Array(response.userHandle!), { pad: false }));
81
+ submitForm();
82
+ } catch (err) {
83
+ setError(String(err));
84
+ submitForm();
85
+ }
86
+ });
87
+
88
+ const webAuthForm = useRef<HTMLFormElement>(null);
89
+ const submitForm = useConstCallback(() => {
90
+ webAuthForm.current!.submit();
91
+ });
92
+
93
+ const [clientDataJSON, setClientDataJSON] = useState("");
94
+ const [authenticatorData, setAuthenticatorData] = useState("");
95
+ const [signature, setSignature] = useState("");
96
+ const [credentialId, setCredentialId] = useState("");
97
+ const [userHandle, setUserHandle] = useState("");
98
+ const [error, setError] = useState("");
99
+
100
+ return (
101
+ <Template
102
+ {...{ kcContext, i18n, doFetchDefaultThemeResources, ...kcProps }}
103
+ headerNode={msg("webauthn-login-title")}
104
+ formNode={
105
+ <div id="kc-form-webauthn" className={cx(kcProps.kcFormClass)}>
106
+ <form id="webauth" action={url.loginAction} ref={webAuthForm} method="post">
107
+ <input type="hidden" id="clientDataJSON" name="clientDataJSON" value={clientDataJSON} />
108
+ <input type="hidden" id="authenticatorData" name="authenticatorData" value={authenticatorData} />
109
+ <input type="hidden" id="signature" name="signature" value={signature} />
110
+ <input type="hidden" id="credentialId" name="credentialId" value={credentialId} />
111
+ <input type="hidden" id="userHandle" name="userHandle" value={userHandle} />
112
+ <input type="hidden" id="error" name="error" value={error} />
113
+ </form>
114
+ <div className={cx(kcProps.kcFormGroupClass)}>
115
+ {authenticators &&
116
+ (() => (
117
+ <form id="authn_select" className={cx(kcProps.kcFormClass)}>
118
+ {authenticators.authenticators.map(authenticator => (
119
+ <input
120
+ type="hidden"
121
+ name="authn_use_chk"
122
+ value={authenticator.credentialId}
123
+ key={authenticator.credentialId}
124
+ />
125
+ ))}
126
+ </form>
127
+ ))()}
128
+ {authenticators &&
129
+ shouldDisplayAuthenticators &&
130
+ (() => (
131
+ <>
132
+ {authenticators.authenticators.length > 1 && (
133
+ <p className={cx(kcProps.kcSelectAuthListItemTitle)}>{msg("webauthn-available-authenticators")}</p>
134
+ )}
135
+ <div className={cx(kcProps.kcFormClass)}>
114
136
  {authenticators.authenticators.map(authenticator => (
115
- <input
116
- type="hidden"
117
- name="authn_use_chk"
118
- value={authenticator.credentialId}
119
- key={authenticator.credentialId}
120
- />
121
- ))}
122
- </form>
123
- ))()}
124
- {authenticators &&
125
- shouldDisplayAuthenticators &&
126
- (() => (
127
- <>
128
- {authenticators.authenticators.length > 1 && (
129
- <p className={cx(props.kcSelectAuthListItemTitle)}>{msg("webauthn-available-authenticators")}</p>
130
- )}
131
- <div className={cx(props.kcFormClass)}>
132
- {authenticators.authenticators.map(authenticator => (
133
- <div id="kc-webauthn-authenticator" className={cx(props.kcSelectAuthListItemClass)}>
134
- <div className={cx(props.kcSelectAuthListItemIconClass)}>
135
- <i
136
- className={cx(
137
- props[authenticator.transports.iconClass] ?? props.kcWebAuthnDefaultIcon,
138
- props.kcSelectAuthListItemIconPropertyClass
139
- )}
140
- />
137
+ <div id="kc-webauthn-authenticator" className={cx(kcProps.kcSelectAuthListItemClass)}>
138
+ <div className={cx(kcProps.kcSelectAuthListItemIconClass)}>
139
+ <i
140
+ className={cx(
141
+ kcProps[authenticator.transports.iconClass] ?? kcProps.kcWebAuthnDefaultIcon,
142
+ kcProps.kcSelectAuthListItemIconPropertyClass
143
+ )}
144
+ />
145
+ </div>
146
+ <div className={cx(kcProps.kcSelectAuthListItemBodyClass)}>
147
+ <div
148
+ id="kc-webauthn-authenticator-label"
149
+ className={cx(kcProps.kcSelectAuthListItemHeadingClass)}
150
+ >
151
+ {authenticator.label}
141
152
  </div>
142
- <div className={cx(props.kcSelectAuthListItemBodyClass)}>
153
+
154
+ {authenticator.transports && authenticator.transports.displayNameProperties.length && (
143
155
  <div
144
- id="kc-webauthn-authenticator-label"
145
- className={cx(props.kcSelectAuthListItemHeadingClass)}
156
+ id="kc-webauthn-authenticator-transport"
157
+ className={cx(kcProps.kcSelectAuthListItemDescriptionClass)}
146
158
  >
147
- {authenticator.label}
159
+ {authenticator.transports.displayNameProperties.map(
160
+ (transport: MessageKeyBase, index: number) => (
161
+ <>
162
+ <span>{msg(transport)}</span>
163
+ {index < authenticator.transports.displayNameProperties.length - 1 && (
164
+ <span>{", "}</span>
165
+ )}
166
+ </>
167
+ )
168
+ )}
148
169
  </div>
170
+ )}
149
171
 
150
- {authenticator.transports && authenticator.transports.displayNameProperties.length && (
151
- <div
152
- id="kc-webauthn-authenticator-transport"
153
- className={cx(props.kcSelectAuthListItemDescriptionClass)}
154
- >
155
- {authenticator.transports.displayNameProperties.map(
156
- (transport: MessageKeyBase, index: number) => (
157
- <>
158
- <span>{msg(transport)}</span>
159
- {index < authenticator.transports.displayNameProperties.length - 1 && (
160
- <span>{", "}</span>
161
- )}
162
- </>
163
- )
164
- )}
165
- </div>
166
- )}
167
-
168
- <div className={cx(props.kcSelectAuthListItemDescriptionClass)}>
169
- <span id="kc-webauthn-authenticator-created-label">
170
- {msg("webauthn-createdAt-label")}
171
- </span>
172
- <span id="kc-webauthn-authenticator-created">{authenticator.createdAt}</span>
173
- </div>
172
+ <div className={cx(kcProps.kcSelectAuthListItemDescriptionClass)}>
173
+ <span id="kc-webauthn-authenticator-created-label">{msg("webauthn-createdAt-label")}</span>
174
+ <span id="kc-webauthn-authenticator-created">{authenticator.createdAt}</span>
174
175
  </div>
175
- <div className={cx(props.kcSelectAuthListItemFillClass)} />
176
176
  </div>
177
- ))}
178
- </div>
179
- </>
180
- ))()}
181
- <div id="kc-form-buttons" className={cx(props.kcFormButtonsClass)}>
182
- <input
183
- id="authenticateWebAuthnButton"
184
- type="button"
185
- onClick={webAuthnAuthenticate}
186
- autoFocus={true}
187
- value={msgStr("webauthn-doAuthenticate")}
188
- className={cx(
189
- props.kcButtonClass,
190
- props.kcButtonPrimaryClass,
191
- props.kcButtonBlockClass,
192
- props.kcButtonLargeClass
193
- )}
194
- />
195
- </div>
177
+ <div className={cx(kcProps.kcSelectAuthListItemFillClass)} />
178
+ </div>
179
+ ))}
180
+ </div>
181
+ </>
182
+ ))()}
183
+ <div id="kc-form-buttons" className={cx(kcProps.kcFormButtonsClass)}>
184
+ <input
185
+ id="authenticateWebAuthnButton"
186
+ type="button"
187
+ onClick={webAuthnAuthenticate}
188
+ autoFocus={true}
189
+ value={msgStr("webauthn-doAuthenticate")}
190
+ className={cx(
191
+ kcProps.kcButtonClass,
192
+ kcProps.kcButtonPrimaryClass,
193
+ kcProps.kcButtonBlockClass,
194
+ kcProps.kcButtonLargeClass
195
+ )}
196
+ />
196
197
  </div>
197
198
  </div>
198
- }
199
- />
200
- );
201
- }
202
- );
199
+ </div>
200
+ }
201
+ />
202
+ );
203
+ });
203
204
 
204
205
  export default WebauthnAuthenticate;