@oussemasahbeni/keycloakify-login-shadcn 250004.0.7 → 250004.0.8

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 (104) hide show
  1. package/keycloak-theme/components/langauges.tsx +1 -1
  2. package/keycloak-theme/components/theme-toggle.tsx +0 -1
  3. package/keycloak-theme/components/ui/alert.tsx +1 -2
  4. package/keycloak-theme/components/ui/button.tsx +1 -2
  5. package/keycloak-theme/components/ui/card.tsx +0 -1
  6. package/keycloak-theme/components/ui/checkbox.tsx +0 -1
  7. package/keycloak-theme/components/ui/dropdown-menu.tsx +14 -4
  8. package/keycloak-theme/components/ui/field.tsx +0 -1
  9. package/keycloak-theme/components/ui/input-otp.tsx +0 -1
  10. package/keycloak-theme/components/ui/input.tsx +0 -1
  11. package/keycloak-theme/components/ui/label.tsx +1 -2
  12. package/keycloak-theme/components/ui/radio-group.tsx +0 -1
  13. package/keycloak-theme/components/ui/select.tsx +12 -4
  14. package/keycloak-theme/components/ui/separator.tsx +0 -1
  15. package/keycloak-theme/components/ui/tooltip.tsx +0 -1
  16. package/keycloak-theme/login/KcPage.tsx +2 -4
  17. package/keycloak-theme/login/components/LogoutOtherSessions.tsx +3 -5
  18. package/keycloak-theme/login/components/PasswordWrapper.tsx +4 -4
  19. package/keycloak-theme/login/components/Template/Template.tsx +108 -56
  20. package/keycloak-theme/login/components/UserProfileFormFields/AddRemoveButtonsMultiValuedAttribute.tsx +7 -3
  21. package/keycloak-theme/login/components/UserProfileFormFields/FieldErrors.tsx +8 -4
  22. package/keycloak-theme/login/components/UserProfileFormFields/GroupLabel.tsx +33 -14
  23. package/keycloak-theme/login/components/UserProfileFormFields/InputFieldByType.tsx +9 -2
  24. package/keycloak-theme/login/components/UserProfileFormFields/InputLabel.tsx +0 -1
  25. package/keycloak-theme/login/components/UserProfileFormFields/InputTag.tsx +25 -8
  26. package/keycloak-theme/login/components/UserProfileFormFields/InputTagSelects.tsx +30 -16
  27. package/keycloak-theme/login/components/UserProfileFormFields/SelectTag.tsx +32 -11
  28. package/keycloak-theme/login/components/UserProfileFormFields/TextareaTag.tsx +19 -7
  29. package/keycloak-theme/login/components/UserProfileFormFields/UserProfileFormFields.tsx +11 -5
  30. package/keycloak-theme/login/mocks/KcPageStory.tsx +6 -2
  31. package/keycloak-theme/login/pages/PageIndex.tsx +0 -4
  32. package/keycloak-theme/login/pages/code/Page.stories.tsx +4 -5
  33. package/keycloak-theme/login/pages/code/Page.tsx +6 -6
  34. package/keycloak-theme/login/pages/delete-account-confirm/Page.stories.tsx +0 -2
  35. package/keycloak-theme/login/pages/delete-account-confirm/Page.tsx +3 -6
  36. package/keycloak-theme/login/pages/delete-credential/Page.stories.tsx +0 -1
  37. package/keycloak-theme/login/pages/delete-credential/Page.tsx +11 -6
  38. package/keycloak-theme/login/pages/error/Page.stories.tsx +0 -1
  39. package/keycloak-theme/login/pages/error/Page.tsx +13 -12
  40. package/keycloak-theme/login/pages/frontchannel-logout/Page.tsx +2 -4
  41. package/keycloak-theme/login/pages/idp-review-user-profile/Page.stories.tsx +0 -1
  42. package/keycloak-theme/login/pages/idp-review-user-profile/Page.tsx +2 -5
  43. package/keycloak-theme/login/pages/info/Page.tsx +8 -6
  44. package/keycloak-theme/login/pages/link-idp-action/Page.tsx +5 -3
  45. package/keycloak-theme/login/pages/login/Form.tsx +52 -52
  46. package/keycloak-theme/login/pages/login/Page.stories.tsx +4 -3
  47. package/keycloak-theme/login/pages/login/Page.tsx +0 -1
  48. package/keycloak-theme/login/pages/login/SocialProviders.tsx +8 -22
  49. package/keycloak-theme/login/pages/login-config-totp/Page.stories.tsx +0 -1
  50. package/keycloak-theme/login/pages/login-config-totp/Page.tsx +25 -12
  51. package/keycloak-theme/login/pages/login-idp-link-confirm/Page.stories.tsx +0 -1
  52. package/keycloak-theme/login/pages/login-idp-link-confirm/Page.tsx +4 -7
  53. package/keycloak-theme/login/pages/login-idp-link-confirm-override/Page.stories.tsx +0 -1
  54. package/keycloak-theme/login/pages/login-idp-link-confirm-override/Page.tsx +4 -7
  55. package/keycloak-theme/login/pages/login-idp-link-email/Page.stories.tsx +0 -1
  56. package/keycloak-theme/login/pages/login-idp-link-email/Page.tsx +4 -7
  57. package/keycloak-theme/login/pages/login-oauth-grant/Page.tsx +21 -11
  58. package/keycloak-theme/login/pages/login-oauth2-device-verify-user-code/Page.tsx +5 -7
  59. package/keycloak-theme/login/pages/login-otp/Page.stories.tsx +0 -1
  60. package/keycloak-theme/login/pages/login-otp/Page.tsx +35 -26
  61. package/keycloak-theme/login/pages/login-page-expired/Page.stories.tsx +0 -1
  62. package/keycloak-theme/login/pages/login-page-expired/Page.tsx +4 -6
  63. package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/Page.tsx +153 -96
  64. package/keycloak-theme/login/pages/login-password/Page.tsx +14 -15
  65. package/keycloak-theme/login/pages/login-password/useScript.tsx +0 -1
  66. package/keycloak-theme/login/pages/login-recovery-authn-code-config/Page.tsx +5 -8
  67. package/keycloak-theme/login/pages/login-recovery-authn-code-input/Page.tsx +2 -3
  68. package/keycloak-theme/login/pages/login-reset-otp/Page.stories.tsx +0 -1
  69. package/keycloak-theme/login/pages/login-reset-otp/Page.tsx +3 -4
  70. package/keycloak-theme/login/pages/login-reset-password/Form.tsx +5 -6
  71. package/keycloak-theme/login/pages/login-reset-password/Page.stories.tsx +0 -1
  72. package/keycloak-theme/login/pages/login-reset-password/Page.tsx +3 -3
  73. package/keycloak-theme/login/pages/login-update-password/Page.stories.tsx +0 -1
  74. package/keycloak-theme/login/pages/login-update-password/Page.tsx +5 -7
  75. package/keycloak-theme/login/pages/login-update-profile/Page.stories.tsx +0 -1
  76. package/keycloak-theme/login/pages/login-update-profile/Page.tsx +6 -7
  77. package/keycloak-theme/login/pages/login-username/Page.stories.tsx +0 -1
  78. package/keycloak-theme/login/pages/login-username/Page.tsx +6 -6
  79. package/keycloak-theme/login/pages/login-verify-email/Page.stories.tsx +0 -1
  80. package/keycloak-theme/login/pages/login-verify-email/Page.tsx +3 -4
  81. package/keycloak-theme/login/pages/login-x509-info/Page.stories.tsx +0 -1
  82. package/keycloak-theme/login/pages/login-x509-info/Page.tsx +3 -6
  83. package/keycloak-theme/login/pages/logout-confirm/Page.stories.tsx +0 -1
  84. package/keycloak-theme/login/pages/logout-confirm/Page.tsx +3 -6
  85. package/keycloak-theme/login/pages/register/Form.tsx +8 -7
  86. package/keycloak-theme/login/pages/register/Page.stories.tsx +17 -8
  87. package/keycloak-theme/login/pages/register/TermsAcceptance.tsx +6 -7
  88. package/keycloak-theme/login/pages/saml-post-form/Page.stories.tsx +0 -1
  89. package/keycloak-theme/login/pages/saml-post-form/Page.tsx +4 -6
  90. package/keycloak-theme/login/pages/select-authenticator/Page.stories.tsx +0 -1
  91. package/keycloak-theme/login/pages/select-authenticator/Page.tsx +3 -6
  92. package/keycloak-theme/login/pages/select-organization/Page.tsx +5 -8
  93. package/keycloak-theme/login/pages/terms/Page.tsx +1 -3
  94. package/keycloak-theme/login/pages/update-email/Page.stories.tsx +0 -1
  95. package/keycloak-theme/login/pages/update-email/Page.tsx +6 -7
  96. package/keycloak-theme/login/pages/webauthn-authenticate/Page.stories.tsx +0 -1
  97. package/keycloak-theme/login/pages/webauthn-authenticate/Page.tsx +50 -46
  98. package/keycloak-theme/login/pages/webauthn-error/Page.stories.tsx +2 -5
  99. package/keycloak-theme/login/pages/webauthn-error/Page.tsx +3 -6
  100. package/keycloak-theme/login/pages/webauthn-register/Page.stories.tsx +0 -1
  101. package/keycloak-theme/login/pages/webauthn-register/Page.tsx +4 -4
  102. package/keycloak-theme/login/styleLevelCustomization.tsx +4 -6
  103. package/keycloak-theme/public/site.webmanifest +11 -1
  104. package/package.json +2 -2
@@ -1,6 +1,5 @@
1
-
2
- import { Alert, AlertDescription } from '@/components/ui/alert';
3
- import { Button } from '@/components/ui/button';
1
+ import { Alert, AlertDescription } from "@/components/ui/alert";
2
+ import { Button } from "@/components/ui/button";
4
3
  import { kcSanitize } from "@keycloakify/login-ui/kcSanitize";
5
4
  import { assert } from "tsafe/assert";
6
5
  import { Template } from "../../components/Template";
@@ -8,7 +7,6 @@ import { useI18n } from "../../i18n";
8
7
  import { useKcContext } from "../../KcContext";
9
8
 
10
9
  export function Page() {
11
-
12
10
  const { kcContext } = useKcContext();
13
11
  assert(kcContext.pageId === "info.ftl");
14
12
 
@@ -67,7 +65,9 @@ export function Page() {
67
65
  if (kcContext.pageRedirectUri) {
68
66
  return (
69
67
  <Button type="button" className="mt-2 flex ms-auto">
70
- <a href={kcContext.pageRedirectUri}>{msg("backToApplication")}</a>
68
+ <a href={kcContext.pageRedirectUri}>
69
+ {msg("backToApplication")}
70
+ </a>
71
71
  </Button>
72
72
  );
73
73
  }
@@ -82,7 +82,9 @@ export function Page() {
82
82
  if (kcContext.client.baseUrl) {
83
83
  return (
84
84
  <Button type="button" className="mt-2 flex ms-auto-end">
85
- <a href={kcContext.client.baseUrl}>{msg("backToApplication")}</a>
85
+ <a href={kcContext.client.baseUrl}>
86
+ {msg("backToApplication")}
87
+ </a>
86
88
  </Button>
87
89
  );
88
90
  }
@@ -1,6 +1,6 @@
1
1
  import { Button } from "@/components/ui/button";
2
- import { useI18n } from '@/login/i18n';
3
- import { useKcContext } from '@/login/KcContext';
2
+ import { useI18n } from "@/login/i18n";
3
+ import { useKcContext } from "@/login/KcContext";
4
4
  import { assert } from "tsafe/assert";
5
5
  import { Template } from "../../components/Template";
6
6
 
@@ -15,7 +15,9 @@ export function Page() {
15
15
  headerNode={msg("linkIdpActionTitle", kcContext.idpDisplayName)}
16
16
  displayMessage={false}
17
17
  >
18
- <div id="kc-link-text">{msg("linkIdpActionMessage", kcContext.idpDisplayName)}</div>
18
+ <div id="kc-link-text">
19
+ {msg("linkIdpActionMessage", kcContext.idpDisplayName)}
20
+ </div>
19
21
  <form action={kcContext.url.loginAction} method="post">
20
22
  <div className="flex flex-col sm:flex-row gap-3 sm:justify-between mt-6">
21
23
  <Button
@@ -1,12 +1,12 @@
1
- import { Button } from '@/components/ui/button';
2
- import { Checkbox } from '@/components/ui/checkbox';
3
- import { Field, FieldError, FieldLabel } from '@/components/ui/field';
4
- import { Input } from '@/components/ui/input';
5
- import { Label } from '@/components/ui/label';
6
- import { useKcContext } from '@/login/KcContext';
1
+ import { Button } from "@/components/ui/button";
2
+ import { Checkbox } from "@/components/ui/checkbox";
3
+ import { Field, FieldError, FieldLabel } from "@/components/ui/field";
4
+ import { Input } from "@/components/ui/input";
5
+ import { Label } from "@/components/ui/label";
6
+ import { useKcContext } from "@/login/KcContext";
7
7
  import { kcSanitize } from "@keycloakify/login-ui/kcSanitize";
8
8
  import { useKcClsx } from "@keycloakify/login-ui/useKcClsx";
9
- import { Fingerprint } from 'lucide-react';
9
+ import { Fingerprint } from "lucide-react";
10
10
  import { useState } from "react";
11
11
  import { assert } from "tsafe/assert";
12
12
  import { PasswordWrapper } from "../../components/PasswordWrapper";
@@ -49,8 +49,8 @@ export function Form() {
49
49
  {!kcContext.realm.loginWithEmailAllowed
50
50
  ? msg("email")
51
51
  : !kcContext.realm.registrationEmailAsUsername
52
- ? msg("usernameOrEmail")
53
- : msg("username")}
52
+ ? msg("usernameOrEmail")
53
+ : msg("username")}
54
54
  </FieldLabel>
55
55
  <Input
56
56
  tabIndex={2}
@@ -69,21 +69,21 @@ export function Form() {
69
69
  "username",
70
70
  "password"
71
71
  ) && (
72
- <FieldError>
73
- <span
74
- id="input-error"
75
- aria-live="polite"
76
- dangerouslySetInnerHTML={{
77
- __html: kcSanitize(
78
- kcContext.messagesPerField.getFirstError(
79
- "username",
80
- "password"
81
- )
72
+ <FieldError>
73
+ <span
74
+ id="input-error"
75
+ aria-live="polite"
76
+ dangerouslySetInnerHTML={{
77
+ __html: kcSanitize(
78
+ kcContext.messagesPerField.getFirstError(
79
+ "username",
80
+ "password"
82
81
  )
83
- }}
84
- />
85
- </FieldError>
86
- )}
82
+ )
83
+ }}
84
+ />
85
+ </FieldError>
86
+ )}
87
87
  </Field>
88
88
  )}
89
89
 
@@ -91,7 +91,7 @@ export function Form() {
91
91
  <FieldLabel htmlFor="password">
92
92
  {msg("password")}
93
93
  </FieldLabel>
94
- <PasswordWrapper passwordInputId="password" >
94
+ <PasswordWrapper passwordInputId="password">
95
95
  <Input
96
96
  tabIndex={3}
97
97
  type="password"
@@ -104,7 +104,10 @@ export function Form() {
104
104
  )}
105
105
  />
106
106
  </PasswordWrapper>
107
- {kcContext.messagesPerField.existsError("username", "password") && (
107
+ {kcContext.messagesPerField.existsError(
108
+ "username",
109
+ "password"
110
+ ) && (
108
111
  <FieldError>
109
112
  <span
110
113
  id="input-error"
@@ -124,30 +127,35 @@ export function Form() {
124
127
 
125
128
  <div className=" space-y-1 my-3 flex justify-between text-xs ">
126
129
  <div>
127
- {kcContext.realm.rememberMe && !kcContext.usernameHidden && (
128
- <div className="flex items-center space-x-2 ">
129
- <Checkbox
130
- tabIndex={5}
131
- id="rememberMe"
132
- name="rememberMe"
133
- defaultChecked={!!kcContext.login.rememberMe}
134
- />
130
+ {kcContext.realm.rememberMe &&
131
+ !kcContext.usernameHidden && (
132
+ <div className="flex items-center space-x-2 ">
133
+ <Checkbox
134
+ tabIndex={5}
135
+ id="rememberMe"
136
+ name="rememberMe"
137
+ defaultChecked={
138
+ !!kcContext.login.rememberMe
139
+ }
140
+ />
135
141
 
136
- <Label
137
- htmlFor="rememberMe"
138
- className="text-sm font-medium cursor-pointer"
139
- >
140
- {msg("rememberMe")}
141
- </Label>
142
- </div>
143
- )}
142
+ <Label
143
+ htmlFor="rememberMe"
144
+ className="text-sm font-medium cursor-pointer"
145
+ >
146
+ {msg("rememberMe")}
147
+ </Label>
148
+ </div>
149
+ )}
144
150
  </div>
145
151
  <div className="link-style ">
146
152
  {kcContext.realm.resetPasswordAllowed && (
147
153
  <span className=" underline-offset-4 hover:underline">
148
154
  <a
149
155
  tabIndex={6}
150
- href={kcContext.url.loginResetCredentialsUrl}
156
+ href={
157
+ kcContext.url.loginResetCredentialsUrl
158
+ }
151
159
  >
152
160
  <Label className="text-sm font-medium cursor-pointer">
153
161
  {msg("doForgotPassword")}
@@ -181,17 +189,12 @@ export function Form() {
181
189
  </form>
182
190
  )}
183
191
  </div>
184
-
185
192
  </div>
186
193
 
187
194
  {kcContext.enableWebAuthnConditionalUI && (
188
195
  <>
189
196
  <form id="webauth" action={kcContext.url.loginAction} method="post">
190
- <input
191
- type="hidden"
192
- id="clientDataJSON"
193
- name="clientDataJSON"
194
- />
197
+ <input type="hidden" id="clientDataJSON" name="clientDataJSON" />
195
198
  <input
196
199
  type="hidden"
197
200
  id="authenticatorData"
@@ -206,10 +209,7 @@ export function Form() {
206
209
  {kcContext.authenticators !== undefined &&
207
210
  kcContext.authenticators.authenticators.length !== 0 && (
208
211
  <>
209
- <form
210
- id="authn_select"
211
- className={kcClsx("kcFormClass")}
212
- >
212
+ <form id="authn_select" className={kcClsx("kcFormClass")}>
213
213
  {kcContext.authenticators.authenticators.map(
214
214
  (authenticator, i) => (
215
215
  <input
@@ -13,7 +13,6 @@ type Story = StoryObj<typeof meta>;
13
13
 
14
14
  export const Default: Story = {};
15
15
 
16
-
17
16
  export const Arabic: Story = {
18
17
  args: {
19
18
  kcContext: {
@@ -46,7 +45,9 @@ export const WithInvalidCredential: Story = {
46
45
  // existsError() so they are the only ones that need to mock.
47
46
  existsError: (fieldName: string, ...otherFieldNames: string[]) => {
48
47
  const fieldNames = [fieldName, ...otherFieldNames];
49
- return fieldNames.includes("username") || fieldNames.includes("password");
48
+ return (
49
+ fieldNames.includes("username") || fieldNames.includes("password")
50
+ );
50
51
  },
51
52
  get: (fieldName: string) => {
52
53
  if (fieldName === "username" || fieldName === "password") {
@@ -342,4 +343,4 @@ export const WithSocialProvidersAndWithoutRememberMe: Story = {
342
343
  realm: { rememberMe: false }
343
344
  }
344
345
  }
345
- };
346
+ };
@@ -1,4 +1,3 @@
1
-
2
1
  import { assert } from "tsafe/assert";
3
2
  import { Template } from "../../components/Template";
4
3
  import { useI18n } from "../../i18n";
@@ -1,11 +1,11 @@
1
- import { Button } from '@/components/ui/button';
1
+ import { Button } from "@/components/ui/button";
2
2
  import { kcSanitize } from "@keycloakify/login-ui/kcSanitize";
3
3
  import { clsx } from "@keycloakify/login-ui/tools/clsx";
4
4
  import { useKcClsx } from "@keycloakify/login-ui/useKcClsx";
5
5
  import { assert } from "tsafe/assert";
6
6
  import { useI18n } from "../../i18n";
7
7
  import { useKcContext } from "../../KcContext";
8
- import useProviderLogos from './useProviderLogos';
8
+ import useProviderLogos from "./useProviderLogos";
9
9
 
10
10
  /** To use this component make sure that kcContext.social exists */
11
11
  export function SocialProviders() {
@@ -15,7 +15,6 @@ export function SocialProviders() {
15
15
 
16
16
  const providerLogos = useProviderLogos();
17
17
 
18
-
19
18
  const { msg } = useI18n();
20
19
 
21
20
  const { kcClsx } = useKcClsx();
@@ -41,20 +40,16 @@ export function SocialProviders() {
41
40
  </div>
42
41
  <ul
43
42
  className={`mt-4! grid gap-2 sm:grid-cols-1 ${(kcContext.social?.providers?.length ?? 0) > 3 ? "sm:grid-cols-2" : ""}`}
44
-
45
43
  >
46
44
  {kcContext.social.providers.map((...[p, , providers]) => (
47
45
  <li key={p.alias}>
48
- <Button
49
- variant="outline"
50
- className="w-full hover:text-current"
51
- >
46
+ <Button variant="outline" className="w-full hover:text-current">
52
47
  <a
53
48
  id={`social-${p.alias}`}
54
49
  className={clsx(
55
50
  kcClsx(
56
51
  providers.length > 3 &&
57
- "kcFormSocialAccountGridItem"
52
+ "kcFormSocialAccountGridItem"
58
53
  ),
59
54
  "flex items-center justify-center gap-2 "
60
55
  )}
@@ -64,22 +59,16 @@ export function SocialProviders() {
64
59
  <div className={"h-5 w-5"}>
65
60
  {providerLogos[p.alias] ? (
66
61
  <img
67
- src={
68
- providerLogos[p.alias]
69
- }
62
+ src={providerLogos[p.alias]}
70
63
  alt={`${p.displayName} logo`}
71
- className={
72
- "h-full w-auto"
73
- }
64
+ className={"h-full w-auto"}
74
65
  />
75
66
  ) : (
76
67
  // Fallback to the original iconClasses if the logo is not defined
77
68
  p.iconClasses && (
78
69
  <i
79
70
  className={clsx(
80
- kcClsx(
81
- "kcCommonLogoIdP"
82
- ),
71
+ kcClsx("kcCommonLogoIdP"),
83
72
  p.iconClasses,
84
73
  `text-provider-${p.alias}`
85
74
  )}
@@ -91,15 +80,12 @@ export function SocialProviders() {
91
80
 
92
81
  <span
93
82
  dangerouslySetInnerHTML={{
94
- __html: kcSanitize(
95
- p.displayName
96
- )
83
+ __html: kcSanitize(p.displayName)
97
84
  }}
98
85
  ></span>
99
86
  </a>
100
87
  </Button>
101
88
  </li>
102
-
103
89
  ))}
104
90
  </ul>
105
91
  </div>
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  const { KcPageStory } = createKcPageStory({ pageId: "login-config-totp.ftl" });
5
4
 
6
5
  const meta = {
@@ -1,16 +1,15 @@
1
1
  import { Button } from "@/components/ui/button";
2
2
  import { Field, FieldError, FieldLabel } from "@/components/ui/field";
3
3
  import { Input } from "@/components/ui/input";
4
- import { LogoutOtherSessions } from '@/login/components/LogoutOtherSessions';
5
- import { useI18n } from '@/login/i18n';
6
- import { useKcContext } from '@/login/KcContext';
7
- import { useKcClsx } from '@keycloakify/login-ui/useKcClsx';
4
+ import { LogoutOtherSessions } from "@/login/components/LogoutOtherSessions";
5
+ import { useI18n } from "@/login/i18n";
6
+ import { useKcContext } from "@/login/KcContext";
7
+ import { useKcClsx } from "@keycloakify/login-ui/useKcClsx";
8
8
  import { kcSanitize } from "keycloakify/lib/kcSanitize";
9
9
  import { assert } from "tsafe/assert";
10
10
  import { Template } from "../../components/Template";
11
11
 
12
12
  export function Page() {
13
-
14
13
  const { kcContext } = useKcContext();
15
14
  assert(kcContext.pageId === "login-config-totp.ftl");
16
15
 
@@ -60,7 +59,10 @@ export function Page() {
60
59
  </div>
61
60
  <div className="mt-4">
62
61
  <Button variant="outline" asChild>
63
- <a href={kcContext.totp.qrUrl} className="text-sm">
62
+ <a
63
+ href={kcContext.totp.qrUrl}
64
+ className="text-sm"
65
+ >
64
66
  {msg("loginTotpScanBarcode")}
65
67
  </a>
66
68
  </Button>
@@ -76,7 +78,9 @@ export function Page() {
76
78
  {msg("loginTotpType")}:
77
79
  </span>
78
80
  <span className="font-mono bg-secondary px-2 py-1 rounded text-xs">
79
- {msg(`loginTotp.${kcContext.totp.policy.type}`)}
81
+ {msg(
82
+ `loginTotp.${kcContext.totp.policy.type}`
83
+ )}
80
84
  </span>
81
85
  </div>
82
86
  <div className="flex justify-between">
@@ -105,7 +109,8 @@ export function Page() {
105
109
  <span className="font-mono bg-secondary px-2 py-1 rounded text-xs">
106
110
  {kcContext.totp.policy.type === "totp"
107
111
  ? kcContext.totp.policy.period
108
- : kcContext.totp.policy.initialCounter}
112
+ : kcContext.totp.policy
113
+ .initialCounter}
109
114
  </span>
110
115
  </div>
111
116
  </div>
@@ -152,7 +157,9 @@ export function Page() {
152
157
  id="totp"
153
158
  name="totp"
154
159
  autoComplete="off"
155
- aria-invalid={kcContext.messagesPerField.existsError("totp")}
160
+ aria-invalid={kcContext.messagesPerField.existsError(
161
+ "totp"
162
+ )}
156
163
  />
157
164
  {kcContext.messagesPerField.existsError("totp") && (
158
165
  <FieldError>
@@ -173,7 +180,9 @@ export function Page() {
173
180
  name="totpSecret"
174
181
  value={kcContext.totp.totpSecret}
175
182
  />
176
- {kcContext.mode && <input type="hidden" id="mode" value={kcContext.mode} />}
183
+ {kcContext.mode && (
184
+ <input type="hidden" id="mode" value={kcContext.mode} />
185
+ )}
177
186
  </div>
178
187
 
179
188
  <div className={kcClsx("kcFormGroupClass")}>
@@ -189,7 +198,9 @@ export function Page() {
189
198
  id="userLabel"
190
199
  name="userLabel"
191
200
  autoComplete="off"
192
- aria-invalid={kcContext.messagesPerField.existsError("userLabel")}
201
+ aria-invalid={kcContext.messagesPerField.existsError(
202
+ "userLabel"
203
+ )}
193
204
  />
194
205
  {kcContext.messagesPerField.existsError("userLabel") && (
195
206
  <FieldError>
@@ -197,7 +208,9 @@ export function Page() {
197
208
  <span
198
209
  dangerouslySetInnerHTML={{
199
210
  __html: kcSanitize(
200
- kcContext.messagesPerField.get("userLabel")
211
+ kcContext.messagesPerField.get(
212
+ "userLabel"
213
+ )
201
214
  )
202
215
  }}
203
216
  />
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  // Mock kcContext to avoid the TS2304 error
5
4
  const mockKcContext = {
6
5
  url: {
@@ -1,10 +1,9 @@
1
1
  import { Button } from "@/components/ui/button";
2
- import { useI18n } from '@/login/i18n';
3
- import { useKcContext } from '@/login/KcContext';
4
- import { assert } from 'tsafe/assert';
2
+ import { useI18n } from "@/login/i18n";
3
+ import { useKcContext } from "@/login/KcContext";
4
+ import { assert } from "tsafe/assert";
5
5
  import { Template } from "../../components/Template";
6
6
 
7
-
8
7
  export function Page() {
9
8
  const { kcContext } = useKcContext();
10
9
  assert(kcContext.pageId === "login-idp-link-confirm.ftl");
@@ -12,9 +11,7 @@ export function Page() {
12
11
  const { msg } = useI18n();
13
12
 
14
13
  return (
15
- <Template
16
- headerNode={msg("confirmLinkIdpTitle")}
17
- >
14
+ <Template headerNode={msg("confirmLinkIdpTitle")}>
18
15
  <form id="kc-register-form" action={kcContext.url.loginAction} method="post">
19
16
  <div className="flex flex-col gap-4">
20
17
  <Button
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  const { KcPageStory } = createKcPageStory({
5
4
  pageId: "login-idp-link-confirm-override.ftl"
6
5
  });
@@ -1,20 +1,17 @@
1
1
  import { Button } from "@/components/ui/button";
2
- import { useI18n } from '@/login/i18n';
3
- import { useKcContext } from '@/login/KcContext';
4
- import { assert } from 'tsafe/assert';
2
+ import { useI18n } from "@/login/i18n";
3
+ import { useKcContext } from "@/login/KcContext";
4
+ import { assert } from "tsafe/assert";
5
5
  import { Template } from "../../components/Template";
6
6
 
7
7
  export function Page() {
8
8
  const { kcContext } = useKcContext();
9
9
  assert(kcContext.pageId === "login-idp-link-confirm-override.ftl");
10
10
 
11
-
12
11
  const { msg } = useI18n();
13
12
 
14
13
  return (
15
- <Template
16
- headerNode={msg("confirmOverrideIdpTitle")}
17
- >
14
+ <Template headerNode={msg("confirmOverrideIdpTitle")}>
18
15
  <form
19
16
  id="kc-register-form"
20
17
  action={kcContext.url.loginAction}
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  // Mock kcContext to avoid TS2304 error and to simulate the real environment
5
4
  const mockKcContext = {
6
5
  url: {
@@ -1,20 +1,17 @@
1
1
  import { Alert, AlertDescription } from "@/components/ui/alert";
2
- import { useI18n } from '@/login/i18n';
3
- import { useKcContext } from '@/login/KcContext';
4
- import { assert } from 'tsafe/assert';
2
+ import { useI18n } from "@/login/i18n";
3
+ import { useKcContext } from "@/login/KcContext";
4
+ import { assert } from "tsafe/assert";
5
5
  import { Template } from "../../components/Template";
6
6
 
7
7
  export function Page() {
8
-
9
8
  const { kcContext } = useKcContext();
10
9
  assert(kcContext.pageId === "login-idp-link-email.ftl");
11
10
 
12
11
  const { msg } = useI18n();
13
12
 
14
13
  return (
15
- <Template
16
- headerNode={msg("emailLinkIdpTitle", kcContext.idpAlias)}
17
- >
14
+ <Template headerNode={msg("emailLinkIdpTitle", kcContext.idpAlias)}>
18
15
  <Alert id="instruction1" variant="info" className="my-3">
19
16
  <AlertDescription>
20
17
  {msg(
@@ -1,8 +1,8 @@
1
1
  import { Button } from "@/components/ui/button";
2
2
  import { CardDescription } from "@/components/ui/card";
3
- import { useI18n } from '@/login/i18n';
4
- import { useKcContext } from '@/login/KcContext';
5
- import { assert } from 'tsafe/assert';
3
+ import { useI18n } from "@/login/i18n";
4
+ import { useKcContext } from "@/login/KcContext";
5
+ import { assert } from "tsafe/assert";
6
6
  import { Template } from "../../components/Template";
7
7
 
8
8
  export function Page() {
@@ -11,7 +11,6 @@ export function Page() {
11
11
 
12
12
  const { msg, msgStr, advancedMsg, advancedMsgStr } = useI18n();
13
13
 
14
-
15
14
  return (
16
15
  <Template
17
16
  bodyClassName="oauth"
@@ -26,7 +25,10 @@ export function Page() {
26
25
  )}
27
26
  <p className="text-lg font-medium text-center">
28
27
  {kcContext.client.name
29
- ? msg("oauthGrantTitle", advancedMsgStr(kcContext.client.name))
28
+ ? msg(
29
+ "oauthGrantTitle",
30
+ advancedMsgStr(kcContext.client.name)
31
+ )
30
32
  : msg("oauthGrantTitle", kcContext.client.clientId)}
31
33
  </p>
32
34
  </div>
@@ -58,16 +60,20 @@ export function Page() {
58
60
  ))}
59
61
  </div>
60
62
 
61
- {(kcContext.client.attributes.policyUri || kcContext.client.attributes.tosUri) && (
63
+ {(kcContext.client.attributes.policyUri ||
64
+ kcContext.client.attributes.tosUri) && (
62
65
  <>
63
66
  <div className="space-y-2">
64
67
  <CardDescription className="text-xs">
65
68
  {kcContext.client.name
66
69
  ? msg(
67
- "oauthGrantInformation",
68
- advancedMsgStr(kcContext.client.name)
69
- )
70
- : msg("oauthGrantInformation", kcContext.client.clientId)}
70
+ "oauthGrantInformation",
71
+ advancedMsgStr(kcContext.client.name)
72
+ )
73
+ : msg(
74
+ "oauthGrantInformation",
75
+ kcContext.client.clientId
76
+ )}
71
77
  </CardDescription>
72
78
  <div className="flex flex-wrap gap-2 text-xs">
73
79
  {kcContext.client.attributes.tosUri && (
@@ -97,7 +103,11 @@ export function Page() {
97
103
  </div>
98
104
 
99
105
  <div>
100
- <form className="w-full" action={kcContext.url.oauthAction} method="POST">
106
+ <form
107
+ className="w-full"
108
+ action={kcContext.url.oauthAction}
109
+ method="POST"
110
+ >
101
111
  <input type="hidden" name="code" value={kcContext.oauth.code} />
102
112
  <div className="flex flex-col sm:flex-row gap-3 w-full">
103
113
  <Button