@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.
- package/keycloak-theme/components/langauges.tsx +1 -1
- package/keycloak-theme/components/theme-toggle.tsx +0 -1
- package/keycloak-theme/components/ui/alert.tsx +1 -2
- package/keycloak-theme/components/ui/button.tsx +1 -2
- package/keycloak-theme/components/ui/card.tsx +0 -1
- package/keycloak-theme/components/ui/checkbox.tsx +0 -1
- package/keycloak-theme/components/ui/dropdown-menu.tsx +14 -4
- package/keycloak-theme/components/ui/field.tsx +0 -1
- package/keycloak-theme/components/ui/input-otp.tsx +0 -1
- package/keycloak-theme/components/ui/input.tsx +0 -1
- package/keycloak-theme/components/ui/label.tsx +1 -2
- package/keycloak-theme/components/ui/radio-group.tsx +0 -1
- package/keycloak-theme/components/ui/select.tsx +12 -4
- package/keycloak-theme/components/ui/separator.tsx +0 -1
- package/keycloak-theme/components/ui/tooltip.tsx +0 -1
- package/keycloak-theme/login/KcPage.tsx +2 -4
- package/keycloak-theme/login/components/LogoutOtherSessions.tsx +3 -5
- package/keycloak-theme/login/components/PasswordWrapper.tsx +4 -4
- package/keycloak-theme/login/components/Template/Template.tsx +108 -56
- package/keycloak-theme/login/components/UserProfileFormFields/AddRemoveButtonsMultiValuedAttribute.tsx +7 -3
- package/keycloak-theme/login/components/UserProfileFormFields/FieldErrors.tsx +8 -4
- package/keycloak-theme/login/components/UserProfileFormFields/GroupLabel.tsx +33 -14
- package/keycloak-theme/login/components/UserProfileFormFields/InputFieldByType.tsx +9 -2
- package/keycloak-theme/login/components/UserProfileFormFields/InputLabel.tsx +0 -1
- package/keycloak-theme/login/components/UserProfileFormFields/InputTag.tsx +25 -8
- package/keycloak-theme/login/components/UserProfileFormFields/InputTagSelects.tsx +30 -16
- package/keycloak-theme/login/components/UserProfileFormFields/SelectTag.tsx +32 -11
- package/keycloak-theme/login/components/UserProfileFormFields/TextareaTag.tsx +19 -7
- package/keycloak-theme/login/components/UserProfileFormFields/UserProfileFormFields.tsx +11 -5
- package/keycloak-theme/login/mocks/KcPageStory.tsx +6 -2
- package/keycloak-theme/login/pages/PageIndex.tsx +0 -4
- package/keycloak-theme/login/pages/code/Page.stories.tsx +4 -5
- package/keycloak-theme/login/pages/code/Page.tsx +6 -6
- package/keycloak-theme/login/pages/delete-account-confirm/Page.stories.tsx +0 -2
- package/keycloak-theme/login/pages/delete-account-confirm/Page.tsx +3 -6
- package/keycloak-theme/login/pages/delete-credential/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/delete-credential/Page.tsx +11 -6
- package/keycloak-theme/login/pages/error/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/error/Page.tsx +13 -12
- package/keycloak-theme/login/pages/frontchannel-logout/Page.tsx +2 -4
- package/keycloak-theme/login/pages/idp-review-user-profile/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/idp-review-user-profile/Page.tsx +2 -5
- package/keycloak-theme/login/pages/info/Page.tsx +8 -6
- package/keycloak-theme/login/pages/link-idp-action/Page.tsx +5 -3
- package/keycloak-theme/login/pages/login/Form.tsx +52 -52
- package/keycloak-theme/login/pages/login/Page.stories.tsx +4 -3
- package/keycloak-theme/login/pages/login/Page.tsx +0 -1
- package/keycloak-theme/login/pages/login/SocialProviders.tsx +8 -22
- package/keycloak-theme/login/pages/login-config-totp/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-config-totp/Page.tsx +25 -12
- package/keycloak-theme/login/pages/login-idp-link-confirm/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-idp-link-confirm/Page.tsx +4 -7
- package/keycloak-theme/login/pages/login-idp-link-confirm-override/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-idp-link-confirm-override/Page.tsx +4 -7
- package/keycloak-theme/login/pages/login-idp-link-email/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-idp-link-email/Page.tsx +4 -7
- package/keycloak-theme/login/pages/login-oauth-grant/Page.tsx +21 -11
- package/keycloak-theme/login/pages/login-oauth2-device-verify-user-code/Page.tsx +5 -7
- package/keycloak-theme/login/pages/login-otp/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-otp/Page.tsx +35 -26
- package/keycloak-theme/login/pages/login-page-expired/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-page-expired/Page.tsx +4 -6
- package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/Page.tsx +153 -96
- package/keycloak-theme/login/pages/login-password/Page.tsx +14 -15
- package/keycloak-theme/login/pages/login-password/useScript.tsx +0 -1
- package/keycloak-theme/login/pages/login-recovery-authn-code-config/Page.tsx +5 -8
- package/keycloak-theme/login/pages/login-recovery-authn-code-input/Page.tsx +2 -3
- package/keycloak-theme/login/pages/login-reset-otp/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-reset-otp/Page.tsx +3 -4
- package/keycloak-theme/login/pages/login-reset-password/Form.tsx +5 -6
- package/keycloak-theme/login/pages/login-reset-password/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-reset-password/Page.tsx +3 -3
- package/keycloak-theme/login/pages/login-update-password/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-update-password/Page.tsx +5 -7
- package/keycloak-theme/login/pages/login-update-profile/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-update-profile/Page.tsx +6 -7
- package/keycloak-theme/login/pages/login-username/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-username/Page.tsx +6 -6
- package/keycloak-theme/login/pages/login-verify-email/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-verify-email/Page.tsx +3 -4
- package/keycloak-theme/login/pages/login-x509-info/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-x509-info/Page.tsx +3 -6
- package/keycloak-theme/login/pages/logout-confirm/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/logout-confirm/Page.tsx +3 -6
- package/keycloak-theme/login/pages/register/Form.tsx +8 -7
- package/keycloak-theme/login/pages/register/Page.stories.tsx +17 -8
- package/keycloak-theme/login/pages/register/TermsAcceptance.tsx +6 -7
- package/keycloak-theme/login/pages/saml-post-form/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/saml-post-form/Page.tsx +4 -6
- package/keycloak-theme/login/pages/select-authenticator/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/select-authenticator/Page.tsx +3 -6
- package/keycloak-theme/login/pages/select-organization/Page.tsx +5 -8
- package/keycloak-theme/login/pages/terms/Page.tsx +1 -3
- package/keycloak-theme/login/pages/update-email/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/update-email/Page.tsx +6 -7
- package/keycloak-theme/login/pages/webauthn-authenticate/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/webauthn-authenticate/Page.tsx +50 -46
- package/keycloak-theme/login/pages/webauthn-error/Page.stories.tsx +2 -5
- package/keycloak-theme/login/pages/webauthn-error/Page.tsx +3 -6
- package/keycloak-theme/login/pages/webauthn-register/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/webauthn-register/Page.tsx +4 -4
- package/keycloak-theme/login/styleLevelCustomization.tsx +4 -6
- package/keycloak-theme/public/site.webmanifest +11 -1
- package/package.json +2 -2
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Input } from '@/components/ui/input';
|
|
1
|
+
import { Button } from "@/components/ui/button";
|
|
2
|
+
import { Field, FieldError, FieldLabel } from "@/components/ui/field";
|
|
3
|
+
import { Input } from "@/components/ui/input";
|
|
5
4
|
import { kcSanitize } from "@keycloakify/login-ui/kcSanitize";
|
|
6
5
|
import { assert } from "tsafe/assert";
|
|
7
6
|
import { useKcContext } from "../../KcContext";
|
|
@@ -26,8 +25,8 @@ export function Form() {
|
|
|
26
25
|
{!kcContext.realm.loginWithEmailAllowed
|
|
27
26
|
? msg("username")
|
|
28
27
|
: !kcContext.realm.registrationEmailAsUsername
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
? msg("usernameOrEmail")
|
|
29
|
+
: msg("email")}
|
|
31
30
|
</FieldLabel>
|
|
32
31
|
<Input
|
|
33
32
|
type="text"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useI18n } from
|
|
2
|
-
import { useKcContext } from
|
|
1
|
+
import { useI18n } from "@/login/i18n";
|
|
2
|
+
import { useKcContext } from "@/login/KcContext";
|
|
3
3
|
import { assert } from "tsafe/assert";
|
|
4
4
|
import { Template } from "../../components/Template";
|
|
5
|
-
import { Form } from
|
|
5
|
+
import { Form } from "./Form";
|
|
6
6
|
|
|
7
7
|
export function Page() {
|
|
8
8
|
const { kcContext } = useKcContext();
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
2
1
|
import { Button } from "@/components/ui/button";
|
|
3
2
|
import { Field, FieldError, FieldLabel } from "@/components/ui/field";
|
|
4
3
|
import { Input } from "@/components/ui/input";
|
|
5
|
-
import { LogoutOtherSessions } from
|
|
6
|
-
import { PasswordWrapper } from
|
|
7
|
-
import { useI18n } from
|
|
8
|
-
import { useKcContext } from
|
|
4
|
+
import { LogoutOtherSessions } from "@/login/components/LogoutOtherSessions";
|
|
5
|
+
import { PasswordWrapper } from "@/login/components/PasswordWrapper";
|
|
6
|
+
import { useI18n } from "@/login/i18n";
|
|
7
|
+
import { useKcContext } from "@/login/KcContext";
|
|
9
8
|
import { kcSanitize } from "keycloakify/lib/kcSanitize";
|
|
10
9
|
import { assert } from "tsafe/assert";
|
|
11
10
|
import { Template } from "../../components/Template";
|
|
12
11
|
|
|
13
12
|
export function Page() {
|
|
14
|
-
|
|
15
13
|
const { kcContext } = useKcContext();
|
|
16
14
|
assert(kcContext.pageId === "login-update-password.ftl");
|
|
17
15
|
|
|
@@ -32,7 +30,7 @@ export function Page() {
|
|
|
32
30
|
>
|
|
33
31
|
<Field>
|
|
34
32
|
<FieldLabel htmlFor="password-new">{msg("passwordNew")}</FieldLabel>
|
|
35
|
-
<PasswordWrapper passwordInputId="password-new"
|
|
33
|
+
<PasswordWrapper passwordInputId="password-new">
|
|
36
34
|
<Input
|
|
37
35
|
type="password"
|
|
38
36
|
id="password-new"
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { Button } from "@/components/ui/button";
|
|
2
|
-
import { useI18n } from
|
|
3
|
-
import { useKcContext } from
|
|
4
|
-
import { useKcClsx } from
|
|
2
|
+
import { useI18n } from "@/login/i18n";
|
|
3
|
+
import { useKcContext } from "@/login/KcContext";
|
|
4
|
+
import { useKcClsx } from "@keycloakify/login-ui/useKcClsx";
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import { assert } from "tsafe/assert";
|
|
7
7
|
import { Template } from "../../components/Template";
|
|
8
8
|
import { UserProfileFormFields } from "../../components/UserProfileFormFields";
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
10
|
export function Page() {
|
|
13
|
-
|
|
14
11
|
const { kcContext } = useKcContext();
|
|
15
12
|
assert(kcContext.pageId === "login-update-profile.ftl");
|
|
16
13
|
|
|
@@ -34,7 +31,9 @@ export function Page() {
|
|
|
34
31
|
action={url.loginAction}
|
|
35
32
|
method="post"
|
|
36
33
|
>
|
|
37
|
-
<UserProfileFormFields
|
|
34
|
+
<UserProfileFormFields
|
|
35
|
+
onIsFormSubmittableValueChange={setIsFormSubmittable}
|
|
36
|
+
/>
|
|
38
37
|
|
|
39
38
|
<div className={kcClsx("kcFormGroupClass")}>
|
|
40
39
|
<div id="kc-form-options" className={kcClsx("kcFormOptionsClass")}>
|
|
@@ -6,14 +6,14 @@ import { clsx } from "keycloakify/tools/clsx";
|
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
|
|
8
8
|
import { Field, FieldError, FieldLabel } from "@/components/ui/field";
|
|
9
|
-
import { useI18n } from
|
|
10
|
-
import { useKcContext } from
|
|
11
|
-
import { useKcClsx } from
|
|
9
|
+
import { useI18n } from "@/login/i18n";
|
|
10
|
+
import { useKcContext } from "@/login/KcContext";
|
|
11
|
+
import { useKcClsx } from "@keycloakify/login-ui/useKcClsx";
|
|
12
12
|
import { kcSanitize } from "keycloakify/lib/kcSanitize";
|
|
13
13
|
import { Fingerprint } from "lucide-react";
|
|
14
14
|
import { assert } from "tsafe/assert";
|
|
15
15
|
import { Template } from "../../components/Template";
|
|
16
|
-
import { useScript } from
|
|
16
|
+
import { useScript } from "./useScript";
|
|
17
17
|
|
|
18
18
|
export function Page() {
|
|
19
19
|
const { kcContext } = useKcContext();
|
|
@@ -123,8 +123,8 @@ export function Page() {
|
|
|
123
123
|
{!realm.loginWithEmailAllowed
|
|
124
124
|
? msg("email")
|
|
125
125
|
: !realm.registrationEmailAsUsername
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
? msg("usernameOrEmail")
|
|
127
|
+
: msg("username")}
|
|
128
128
|
</FieldLabel>
|
|
129
129
|
<Input
|
|
130
130
|
tabIndex={2}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { useI18n } from
|
|
2
|
-
import { useKcContext } from
|
|
3
|
-
import { assert } from
|
|
1
|
+
import { useI18n } from "@/login/i18n";
|
|
2
|
+
import { useKcContext } from "@/login/KcContext";
|
|
3
|
+
import { assert } from "tsafe/assert";
|
|
4
4
|
import { Template } from "../../components/Template";
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
export function Page() {
|
|
8
7
|
const { kcContext } = useKcContext();
|
|
9
8
|
assert(kcContext.pageId === "login-verify-email.ftl");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button } from "@/components/ui/button";
|
|
2
2
|
import { Label } from "@/components/ui/label";
|
|
3
|
-
import { useI18n } from
|
|
4
|
-
import { useKcContext } from
|
|
3
|
+
import { useI18n } from "@/login/i18n";
|
|
4
|
+
import { useKcContext } from "@/login/KcContext";
|
|
5
5
|
import { assert } from "tsafe/assert";
|
|
6
6
|
import { Template } from "../../components/Template";
|
|
7
7
|
|
|
@@ -9,15 +9,12 @@ export function Page() {
|
|
|
9
9
|
const { kcContext } = useKcContext();
|
|
10
10
|
assert(kcContext.pageId === "login-x509-info.ftl");
|
|
11
11
|
|
|
12
|
-
|
|
13
12
|
const { url, x509 } = kcContext;
|
|
14
13
|
|
|
15
14
|
const { msg, msgStr } = useI18n();
|
|
16
15
|
|
|
17
16
|
return (
|
|
18
|
-
<Template
|
|
19
|
-
headerNode={msg("doLogIn")}
|
|
20
|
-
>
|
|
17
|
+
<Template headerNode={msg("doLogIn")}>
|
|
21
18
|
<form
|
|
22
19
|
id="kc-x509-login-info"
|
|
23
20
|
className="space-y-6"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button } from "@/components/ui/button";
|
|
2
|
-
import { useI18n } from
|
|
3
|
-
import { useKcContext } from
|
|
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
|
|
|
@@ -8,14 +8,11 @@ export function Page() {
|
|
|
8
8
|
const { kcContext } = useKcContext();
|
|
9
9
|
assert(kcContext.pageId === "logout-confirm.ftl");
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
const { url, client, logoutConfirm } = kcContext;
|
|
13
12
|
|
|
14
13
|
const { msg, msgStr } = useI18n();
|
|
15
14
|
return (
|
|
16
|
-
<Template
|
|
17
|
-
headerNode={msg("logoutConfirmTitle")}
|
|
18
|
-
>
|
|
15
|
+
<Template headerNode={msg("logoutConfirmTitle")}>
|
|
19
16
|
<div className="space-y-4">
|
|
20
17
|
<p className="text-foreground ">{msg("logoutConfirmHeader")}</p>
|
|
21
18
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button } from
|
|
1
|
+
import { Button } from "@/components/ui/button";
|
|
2
2
|
import { clsx } from "@keycloakify/login-ui/tools/clsx";
|
|
3
3
|
import { useKcClsx } from "@keycloakify/login-ui/useKcClsx";
|
|
4
4
|
import { useLayoutEffect, useState } from "react";
|
|
@@ -35,7 +35,9 @@ export function Form() {
|
|
|
35
35
|
className="space-y-3"
|
|
36
36
|
method="post"
|
|
37
37
|
>
|
|
38
|
-
<UserProfileFormFields
|
|
38
|
+
<UserProfileFormFields
|
|
39
|
+
onIsFormSubmittableValueChange={setIsFormSubmittable}
|
|
40
|
+
/>
|
|
39
41
|
{kcContext.termsAcceptanceRequired && (
|
|
40
42
|
<TermsAcceptance
|
|
41
43
|
messagesPerField={kcContext.messagesPerField}
|
|
@@ -44,7 +46,8 @@ export function Form() {
|
|
|
44
46
|
/>
|
|
45
47
|
)}
|
|
46
48
|
{kcContext.recaptchaRequired &&
|
|
47
|
-
(kcContext.recaptchaVisible ||
|
|
49
|
+
(kcContext.recaptchaVisible ||
|
|
50
|
+
kcContext.recaptchaAction === undefined) && (
|
|
48
51
|
<div className="form-group">
|
|
49
52
|
<div className={kcClsx("kcInputWrapperClass")}>
|
|
50
53
|
<div
|
|
@@ -57,10 +60,9 @@ export function Form() {
|
|
|
57
60
|
</div>
|
|
58
61
|
)}
|
|
59
62
|
<div className={kcClsx("kcFormGroupClass")}>
|
|
60
|
-
|
|
61
63
|
{kcContext.recaptchaRequired &&
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
!kcContext.recaptchaVisible &&
|
|
65
|
+
kcContext.recaptchaAction !== undefined ? (
|
|
64
66
|
<div id="kc-form-buttons" className={kcClsx("kcFormButtonsClass")}>
|
|
65
67
|
<button
|
|
66
68
|
className={clsx(
|
|
@@ -100,7 +102,6 @@ export function Form() {
|
|
|
100
102
|
<a href={kcContext.url.loginUrl}>{msg("backToLogin")}</a>
|
|
101
103
|
</Button>
|
|
102
104
|
</div>
|
|
103
|
-
|
|
104
105
|
</form>
|
|
105
106
|
);
|
|
106
107
|
}
|
|
@@ -59,7 +59,8 @@ export const WithEmailAlreadyExists: Story = {
|
|
|
59
59
|
// existsError() so they are the only ones that need to mock.
|
|
60
60
|
existsError: (fieldName: string, ...otherFieldNames: string[]) =>
|
|
61
61
|
[fieldName, ...otherFieldNames].includes("email"),
|
|
62
|
-
get: (fieldName: string) =>
|
|
62
|
+
get: (fieldName: string) =>
|
|
63
|
+
fieldName === "email" ? "Email already exists." : undefined
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
}
|
|
@@ -73,12 +74,15 @@ export const WithRestrictedToMITStudents: Story = {
|
|
|
73
74
|
email: {
|
|
74
75
|
validators: {
|
|
75
76
|
pattern: {
|
|
76
|
-
pattern:
|
|
77
|
-
|
|
77
|
+
pattern:
|
|
78
|
+
"^[^@]+@([^.]+\\.)*((mit\\.edu)|(berkeley\\.edu))$",
|
|
79
|
+
"error-message":
|
|
80
|
+
"${profile.attributes.email.pattern.error}"
|
|
78
81
|
}
|
|
79
82
|
},
|
|
80
83
|
annotations: {
|
|
81
|
-
inputHelperTextBefore:
|
|
84
|
+
inputHelperTextBefore:
|
|
85
|
+
"${profile.attributes.email.inputHelperTextBefore}"
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
88
|
}
|
|
@@ -109,7 +113,8 @@ export const WithFavoritePet: Story = {
|
|
|
109
113
|
}
|
|
110
114
|
},
|
|
111
115
|
annotations: {
|
|
112
|
-
inputOptionLabelsI18nPrefix:
|
|
116
|
+
inputOptionLabelsI18nPrefix:
|
|
117
|
+
"profile.attributes.favoritePet.options"
|
|
113
118
|
},
|
|
114
119
|
required: false,
|
|
115
120
|
readOnly: false
|
|
@@ -210,7 +215,8 @@ export const WithTermsAcceptance: Story = {
|
|
|
210
215
|
termsAcceptanceRequired: true,
|
|
211
216
|
"x-keycloakify": {
|
|
212
217
|
messages: {
|
|
213
|
-
termsText:
|
|
218
|
+
termsText:
|
|
219
|
+
"<a href='https://example.com/terms'>Service Terms of Use</a>"
|
|
214
220
|
}
|
|
215
221
|
}
|
|
216
222
|
}
|
|
@@ -225,7 +231,9 @@ export const WithTermsNotAccepted: Story = {
|
|
|
225
231
|
messagesPerField: {
|
|
226
232
|
existsError: (fieldName: string) => fieldName === "termsAccepted",
|
|
227
233
|
get: (fieldName: string) =>
|
|
228
|
-
fieldName === "termsAccepted"
|
|
234
|
+
fieldName === "termsAccepted"
|
|
235
|
+
? "You must accept the terms."
|
|
236
|
+
: undefined
|
|
229
237
|
}
|
|
230
238
|
}}
|
|
231
239
|
/>
|
|
@@ -241,7 +249,8 @@ export const WithFieldErrors: Story = {
|
|
|
241
249
|
}
|
|
242
250
|
},
|
|
243
251
|
messagesPerField: {
|
|
244
|
-
existsError: (fieldName: string) =>
|
|
252
|
+
existsError: (fieldName: string) =>
|
|
253
|
+
["username", "email"].includes(fieldName),
|
|
245
254
|
get: (fieldName: string) => {
|
|
246
255
|
if (fieldName === "username") return "Username is required.";
|
|
247
256
|
if (fieldName === "email") return "Invalid email format.";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Checkbox } from
|
|
2
|
-
import { FieldError } from
|
|
3
|
-
import { Label } from
|
|
4
|
-
import { useI18n } from
|
|
5
|
-
import type { KcContext } from
|
|
1
|
+
import { Checkbox } from "@/components/ui/checkbox";
|
|
2
|
+
import { FieldError } from "@/components/ui/field";
|
|
3
|
+
import { Label } from "@/components/ui/label";
|
|
4
|
+
import { useI18n } from "@/login/i18n";
|
|
5
|
+
import type { KcContext } from "@/login/KcContext";
|
|
6
6
|
import { kcSanitize } from "@keycloakify/login-ui/kcSanitize";
|
|
7
7
|
|
|
8
8
|
export function TermsAcceptance(props: {
|
|
@@ -10,8 +10,7 @@ export function TermsAcceptance(props: {
|
|
|
10
10
|
areTermsAccepted: boolean;
|
|
11
11
|
onAreTermsAcceptedValueChange: (areTermsAccepted: boolean) => void;
|
|
12
12
|
}) {
|
|
13
|
-
const { messagesPerField, areTermsAccepted, onAreTermsAcceptedValueChange } =
|
|
14
|
-
props;
|
|
13
|
+
const { messagesPerField, areTermsAccepted, onAreTermsAcceptedValueChange } = props;
|
|
15
14
|
|
|
16
15
|
const { msg } = useI18n();
|
|
17
16
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useI18n } from
|
|
2
|
-
import { useKcContext } from
|
|
1
|
+
import { useI18n } from "@/login/i18n";
|
|
2
|
+
import { useKcContext } from "@/login/KcContext";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
-
import { assert } from
|
|
4
|
+
import { assert } from "tsafe/assert";
|
|
5
5
|
import { Template } from "../../components/Template";
|
|
6
6
|
|
|
7
7
|
export function Page() {
|
|
@@ -29,9 +29,7 @@ export function Page() {
|
|
|
29
29
|
}, [htmlFormElement]);
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
|
-
<Template
|
|
33
|
-
headerNode={msg("saml.post-form.title")}
|
|
34
|
-
>
|
|
32
|
+
<Template headerNode={msg("saml.post-form.title")}>
|
|
35
33
|
<p>{msg("saml.post-form.message")}</p>
|
|
36
34
|
<form
|
|
37
35
|
name="saml-post-binding"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button } from "@/components/ui/button";
|
|
2
|
-
import { useI18n } from
|
|
3
|
-
import { useKcContext } from
|
|
2
|
+
import { useI18n } from "@/login/i18n";
|
|
3
|
+
import { useKcContext } from "@/login/KcContext";
|
|
4
4
|
import { ChevronRight, Fingerprint, Globe, KeyRound, Shield } from "lucide-react";
|
|
5
5
|
import { FaKey } from "react-icons/fa";
|
|
6
6
|
import { assert } from "tsafe/assert";
|
|
@@ -58,10 +58,7 @@ export function Page() {
|
|
|
58
58
|
|
|
59
59
|
const { msg, advancedMsg } = useI18n();
|
|
60
60
|
return (
|
|
61
|
-
<Template
|
|
62
|
-
displayInfo={false}
|
|
63
|
-
headerNode={msg("loginChooseAuthenticator")}
|
|
64
|
-
>
|
|
61
|
+
<Template displayInfo={false} headerNode={msg("loginChooseAuthenticator")}>
|
|
65
62
|
<form
|
|
66
63
|
id="kc-select-credential-form"
|
|
67
64
|
className="space-y-3"
|
|
@@ -6,14 +6,13 @@ import {
|
|
|
6
6
|
SelectTrigger,
|
|
7
7
|
SelectValue
|
|
8
8
|
} from "@/components/ui/select";
|
|
9
|
-
import { useI18n } from
|
|
10
|
-
import { useKcContext } from
|
|
9
|
+
import { useI18n } from "@/login/i18n";
|
|
10
|
+
import { useKcContext } from "@/login/KcContext";
|
|
11
11
|
import { Building2 } from "lucide-react";
|
|
12
|
-
import { MouseEvent, useRef, useState } from "react";
|
|
13
|
-
import { assert } from
|
|
12
|
+
import { type MouseEvent, useRef, useState } from "react";
|
|
13
|
+
import { assert } from "tsafe/assert";
|
|
14
14
|
import { Template } from "../../components/Template";
|
|
15
15
|
|
|
16
|
-
|
|
17
16
|
export function Page() {
|
|
18
17
|
const { kcContext } = useKcContext();
|
|
19
18
|
assert(kcContext.pageId === "select-organization.ftl");
|
|
@@ -65,9 +64,7 @@ export function Page() {
|
|
|
65
64
|
const useSelect = organizations.length > 3;
|
|
66
65
|
|
|
67
66
|
return (
|
|
68
|
-
<Template
|
|
69
|
-
headerNode={msg("organization.selectTitle")}
|
|
70
|
-
>
|
|
67
|
+
<Template headerNode={msg("organization.selectTitle")}>
|
|
71
68
|
<form ref={formRef} action={kcContext.url.loginAction} method="post">
|
|
72
69
|
<div id="kc-user-organizations" className="space-y-2">
|
|
73
70
|
<h2 className="text-md font-semibold">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button } from
|
|
1
|
+
import { Button } from "@/components/ui/button";
|
|
2
2
|
import { assert } from "tsafe/assert";
|
|
3
3
|
import { useKcContext } from "../../KcContext";
|
|
4
4
|
import { Template } from "../../components/Template";
|
|
@@ -8,7 +8,6 @@ export function Page() {
|
|
|
8
8
|
const { kcContext } = useKcContext();
|
|
9
9
|
assert(kcContext.pageId === "terms.ftl");
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
const { msg, msgStr } = useI18n();
|
|
13
12
|
|
|
14
13
|
const { url } = kcContext;
|
|
@@ -42,7 +41,6 @@ export function Page() {
|
|
|
42
41
|
>
|
|
43
42
|
{msgStr("doAccept")}
|
|
44
43
|
</Button>
|
|
45
|
-
|
|
46
44
|
</div>
|
|
47
45
|
</form>
|
|
48
46
|
</div>
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { Button } from "@/components/ui/button";
|
|
2
|
-
import { LogoutOtherSessions } from
|
|
3
|
-
import { useI18n } from
|
|
4
|
-
import { useKcContext } from
|
|
2
|
+
import { LogoutOtherSessions } from "@/login/components/LogoutOtherSessions";
|
|
3
|
+
import { useI18n } from "@/login/i18n";
|
|
4
|
+
import { useKcContext } from "@/login/KcContext";
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import { assert } from "tsafe/assert";
|
|
7
7
|
import { Template } from "../../components/Template";
|
|
8
8
|
import { UserProfileFormFields } from "../../components/UserProfileFormFields";
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
export function Page() {
|
|
12
|
-
|
|
13
11
|
const { kcContext } = useKcContext();
|
|
14
12
|
assert(kcContext.pageId === "update-email.ftl");
|
|
15
13
|
|
|
16
|
-
|
|
17
14
|
const { msg, msgStr } = useI18n();
|
|
18
15
|
|
|
19
16
|
const [isFormSubmittable, setIsFormSubmittable] = useState(false);
|
|
@@ -32,7 +29,9 @@ export function Page() {
|
|
|
32
29
|
action={url.loginAction}
|
|
33
30
|
method="post"
|
|
34
31
|
>
|
|
35
|
-
<UserProfileFormFields
|
|
32
|
+
<UserProfileFormFields
|
|
33
|
+
onIsFormSubmittableValueChange={setIsFormSubmittable}
|
|
34
|
+
/>
|
|
36
35
|
|
|
37
36
|
<LogoutOtherSessions />
|
|
38
37
|
|