@oussemasahbeni/keycloakify-login-shadcn 250004.0.2 → 250004.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/keycloak-theme/components/ui/alert.tsx +4 -4
- package/keycloak-theme/components/ui/dropdown-menu.tsx +5 -5
- package/keycloak-theme/components/ui/input.tsx +1 -1
- package/keycloak-theme/components/ui/select.tsx +4 -4
- package/keycloak-theme/components/ui/separator.tsx +1 -1
- package/keycloak-theme/login/KcContext.ts +23 -19
- package/keycloak-theme/login/KcPage.tsx +47 -60
- package/keycloak-theme/login/assets/img/auth-logo.svg +100 -100
- package/keycloak-theme/login/assets/img/shape.svg +71 -71
- package/keycloak-theme/login/components/LogoutOtherSessions.tsx +26 -26
- package/keycloak-theme/login/components/PasswordWrapper.tsx +35 -35
- package/keycloak-theme/login/components/Template/Template.tsx +227 -226
- package/keycloak-theme/login/components/Template/index.ts +1 -1
- package/keycloak-theme/login/components/Template/useInitializeTemplate.ts +61 -61
- package/keycloak-theme/login/components/UserProfileFormFields/AddRemoveButtonsMultiValuedAttribute.tsx +61 -61
- package/keycloak-theme/login/components/UserProfileFormFields/DO_MAKE_USER_CONFIRM_PASSWORD.ts +2 -2
- package/keycloak-theme/login/components/UserProfileFormFields/FieldErrors.tsx +28 -28
- package/keycloak-theme/login/components/UserProfileFormFields/GroupLabel.tsx +70 -70
- package/keycloak-theme/login/components/UserProfileFormFields/InputFieldByType.tsx +58 -58
- package/keycloak-theme/login/components/UserProfileFormFields/InputTag.tsx +116 -116
- package/keycloak-theme/login/components/UserProfileFormFields/InputTagSelects.tsx +135 -135
- package/keycloak-theme/login/components/UserProfileFormFields/SelectTag.tsx +114 -114
- package/keycloak-theme/login/components/UserProfileFormFields/TextareaTag.tsx +42 -42
- package/keycloak-theme/login/components/UserProfileFormFields/UserProfileFormFields.tsx +127 -127
- package/keycloak-theme/login/components/UserProfileFormFields/index.ts +1 -1
- package/keycloak-theme/login/i18n.ts +47 -51
- package/keycloak-theme/login/mocks/getKcContextMock.ts +22 -18
- package/keycloak-theme/login/pages/PageIndex.tsx +134 -134
- package/keycloak-theme/login/pages/code/Page.stories.tsx +62 -78
- package/keycloak-theme/login/pages/code/Page.tsx +89 -89
- package/keycloak-theme/login/pages/code/index.ts +3 -3
- package/keycloak-theme/login/pages/delete-account-confirm/Page.stories.tsx +39 -46
- package/keycloak-theme/login/pages/delete-account-confirm/Page.tsx +63 -63
- package/keycloak-theme/login/pages/delete-account-confirm/index.ts +3 -3
- package/keycloak-theme/login/pages/delete-credential/Page.stories.tsx +26 -30
- package/keycloak-theme/login/pages/delete-credential/Page.tsx +51 -51
- package/keycloak-theme/login/pages/delete-credential/index.ts +3 -3
- package/keycloak-theme/login/pages/error/Page.stories.tsx +47 -58
- package/keycloak-theme/login/pages/error/Page.tsx +42 -42
- package/keycloak-theme/login/pages/error/index.ts +3 -3
- package/keycloak-theme/login/pages/frontchannel-logout/Page.stories.tsx +25 -32
- package/keycloak-theme/login/pages/frontchannel-logout/Page.tsx +84 -84
- package/keycloak-theme/login/pages/frontchannel-logout/index.ts +3 -3
- package/keycloak-theme/login/pages/idp-review-user-profile/Page.stories.tsx +46 -58
- package/keycloak-theme/login/pages/idp-review-user-profile/Page.tsx +52 -52
- package/keycloak-theme/login/pages/idp-review-user-profile/index.ts +3 -3
- package/keycloak-theme/login/pages/info/Page.stories.tsx +50 -60
- package/keycloak-theme/login/pages/info/Page.tsx +92 -92
- package/keycloak-theme/login/pages/link-idp-action/Page.stories.tsx +32 -16
- package/keycloak-theme/login/pages/link-idp-action/Page.tsx +43 -43
- package/keycloak-theme/login/pages/link-idp-action/index.ts +3 -3
- package/keycloak-theme/login/pages/login/Form.tsx +242 -242
- package/keycloak-theme/login/pages/login/Info.tsx +29 -29
- package/keycloak-theme/login/pages/login/Page.stories.tsx +345 -365
- package/keycloak-theme/login/pages/login/Page.tsx +44 -44
- package/keycloak-theme/login/pages/login/SocialProviders.tsx +107 -107
- package/keycloak-theme/login/pages/login/index.ts +3 -3
- package/keycloak-theme/login/pages/login/providers/apple.svg +3 -3
- package/keycloak-theme/login/pages/login/providers/bitbucket.svg +11 -11
- package/keycloak-theme/login/pages/login/providers/discord.svg +4 -4
- package/keycloak-theme/login/pages/login/providers/facebook.svg +5 -5
- package/keycloak-theme/login/pages/login/providers/github.svg +3 -3
- package/keycloak-theme/login/pages/login/providers/gitlab.svg +7 -7
- package/keycloak-theme/login/pages/login/providers/google.svg +7 -7
- package/keycloak-theme/login/pages/login/providers/instagram.svg +31 -31
- package/keycloak-theme/login/pages/login/providers/linkedin.svg +3 -3
- package/keycloak-theme/login/pages/login/providers/microsoft.svg +6 -6
- package/keycloak-theme/login/pages/login/providers/oidc.svg +5 -5
- package/keycloak-theme/login/pages/login/providers/openshift.svg +7 -7
- package/keycloak-theme/login/pages/login/providers/paypal.svg +6 -6
- package/keycloak-theme/login/pages/login/providers/slack.svg +11 -11
- package/keycloak-theme/login/pages/login/providers/stackoverflow.svg +5 -5
- package/keycloak-theme/login/pages/login/providers/x.svg +3 -3
- package/keycloak-theme/login/pages/login/useProviderLogos.tsx +39 -39
- package/keycloak-theme/login/pages/login/useScript.tsx +62 -62
- package/keycloak-theme/login/pages/login-config-totp/Page.stories.tsx +45 -59
- package/keycloak-theme/login/pages/login-config-totp/Page.tsx +240 -240
- package/keycloak-theme/login/pages/login-config-totp/index.ts +3 -3
- package/keycloak-theme/login/pages/login-idp-link-confirm/Page.stories.tsx +30 -34
- package/keycloak-theme/login/pages/login-idp-link-confirm/Page.tsx +43 -43
- package/keycloak-theme/login/pages/login-idp-link-confirm/index.ts +3 -3
- package/keycloak-theme/login/pages/login-idp-link-confirm-override/Page.stories.tsx +16 -22
- package/keycloak-theme/login/pages/login-idp-link-confirm-override/Page.tsx +47 -47
- package/keycloak-theme/login/pages/login-idp-link-confirm-override/index.ts +3 -3
- package/keycloak-theme/login/pages/login-idp-link-email/Page.stories.tsx +54 -62
- package/keycloak-theme/login/pages/login-idp-link-email/Page.tsx +54 -54
- package/keycloak-theme/login/pages/login-idp-link-email/index.ts +3 -3
- package/keycloak-theme/login/pages/login-oauth-grant/Page.stories.tsx +39 -45
- package/keycloak-theme/login/pages/login-oauth-grant/Page.tsx +126 -126
- package/keycloak-theme/login/pages/login-oauth-grant/index.ts +3 -3
- package/keycloak-theme/login/pages/login-oauth2-device-verify-user-code/Page.stories.tsx +38 -48
- package/keycloak-theme/login/pages/login-oauth2-device-verify-user-code/Page.tsx +58 -58
- package/keycloak-theme/login/pages/login-oauth2-device-verify-user-code/index.ts +3 -3
- package/keycloak-theme/login/pages/login-otp/Page.stories.tsx +82 -96
- package/keycloak-theme/login/pages/login-otp/Page.tsx +108 -108
- package/keycloak-theme/login/pages/login-otp/index.ts +3 -3
- package/keycloak-theme/login/pages/login-page-expired/Page.stories.tsx +28 -36
- package/keycloak-theme/login/pages/login-page-expired/Page.tsx +47 -47
- package/keycloak-theme/login/pages/login-page-expired/index.ts +3 -3
- package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/Page.stories.tsx +20 -0
- package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/Page.tsx +233 -233
- package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/index.ts +3 -3
- package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/useScript.tsx +63 -63
- package/keycloak-theme/login/pages/login-password/Page.stories.tsx +55 -56
- package/keycloak-theme/login/pages/login-password/Page.tsx +149 -149
- package/keycloak-theme/login/pages/login-password/index.ts +3 -3
- package/keycloak-theme/login/pages/login-password/useScript.tsx +63 -63
- package/keycloak-theme/login/pages/login-recovery-authn-code-config/Page.stories.tsx +28 -36
- package/keycloak-theme/login/pages/login-recovery-authn-code-config/Page.tsx +181 -181
- package/keycloak-theme/login/pages/login-recovery-authn-code-config/index.ts +3 -3
- package/keycloak-theme/login/pages/login-recovery-authn-code-config/useScript.tsx +145 -145
- package/keycloak-theme/login/pages/login-recovery-authn-code-input/Page.stories.tsx +16 -22
- package/keycloak-theme/login/pages/login-recovery-authn-code-input/Page.tsx +70 -70
- package/keycloak-theme/login/pages/login-recovery-authn-code-input/index.ts +3 -3
- package/keycloak-theme/login/pages/login-reset-otp/Page.stories.tsx +62 -74
- package/keycloak-theme/login/pages/login-reset-otp/Page.tsx +86 -86
- package/keycloak-theme/login/pages/login-reset-otp/index.ts +3 -3
- package/keycloak-theme/login/pages/login-reset-password/Form.tsx +68 -68
- package/keycloak-theme/login/pages/login-reset-password/Page.stories.tsx +44 -54
- package/keycloak-theme/login/pages/login-reset-password/Page.tsx +27 -27
- package/keycloak-theme/login/pages/login-reset-password/index.ts +3 -3
- package/keycloak-theme/login/pages/login-update-password/Page.stories.tsx +40 -50
- package/keycloak-theme/login/pages/login-update-password/Page.tsx +111 -111
- package/keycloak-theme/login/pages/login-update-password/index.ts +3 -3
- package/keycloak-theme/login/pages/login-update-profile/Page.stories.tsx +28 -36
- package/keycloak-theme/login/pages/login-update-profile/Page.tsx +68 -68
- package/keycloak-theme/login/pages/login-update-profile/index.ts +3 -3
- package/keycloak-theme/login/pages/login-username/Page.stories.tsx +32 -42
- package/keycloak-theme/login/pages/login-username/Page.tsx +246 -246
- package/keycloak-theme/login/pages/login-username/index.ts +3 -3
- package/keycloak-theme/login/pages/login-username/useScript.tsx +62 -62
- package/keycloak-theme/login/pages/login-verify-email/Page.stories.tsx +68 -80
- package/keycloak-theme/login/pages/login-verify-email/Page.tsx +38 -38
- package/keycloak-theme/login/pages/login-verify-email/index.ts +3 -3
- package/keycloak-theme/login/pages/login-x509-info/Page.stories.tsx +29 -37
- package/keycloak-theme/login/pages/login-x509-info/Page.tsx +75 -75
- package/keycloak-theme/login/pages/login-x509-info/index.ts +3 -3
- package/keycloak-theme/login/pages/logout-confirm/Page.stories.tsx +34 -42
- package/keycloak-theme/login/pages/logout-confirm/Page.tsx +53 -53
- package/keycloak-theme/login/pages/logout-confirm/index.ts +3 -3
- package/keycloak-theme/login/pages/register/Form.tsx +106 -106
- package/keycloak-theme/login/pages/register/Page.stories.tsx +23 -6
- package/keycloak-theme/login/pages/register/Page.tsx +26 -26
- package/keycloak-theme/login/pages/register/TermsAcceptance.tsx +56 -56
- package/keycloak-theme/login/pages/register/index.ts +3 -3
- package/keycloak-theme/login/pages/saml-post-form/Page.stories.tsx +16 -22
- package/keycloak-theme/login/pages/saml-post-form/Page.tsx +66 -66
- package/keycloak-theme/login/pages/saml-post-form/index.ts +3 -3
- package/keycloak-theme/login/pages/select-authenticator/Page.stories.tsx +83 -95
- package/keycloak-theme/login/pages/select-authenticator/Page.tsx +100 -100
- package/keycloak-theme/login/pages/select-authenticator/index.ts +3 -3
- package/keycloak-theme/login/pages/select-organization/Page.stories.tsx +62 -49
- package/keycloak-theme/login/pages/select-organization/Page.tsx +126 -126
- package/keycloak-theme/login/pages/select-organization/index.ts +3 -3
- package/keycloak-theme/login/pages/terms/Page.stories.tsx +15 -0
- package/keycloak-theme/login/pages/terms/Page.tsx +51 -51
- package/keycloak-theme/login/pages/terms/index.ts +3 -3
- package/keycloak-theme/login/pages/update-email/Page.stories.tsx +27 -35
- package/keycloak-theme/login/pages/update-email/Page.tsx +62 -62
- package/keycloak-theme/login/pages/update-email/index.ts +3 -3
- package/keycloak-theme/login/pages/webauthn-authenticate/Page.stories.tsx +112 -126
- package/keycloak-theme/login/pages/webauthn-authenticate/Page.tsx +202 -202
- package/keycloak-theme/login/pages/webauthn-authenticate/index.ts +3 -3
- package/keycloak-theme/login/pages/webauthn-authenticate/useScript.tsx +55 -55
- package/keycloak-theme/login/pages/webauthn-error/Page.stories.tsx +54 -66
- package/keycloak-theme/login/pages/webauthn-error/Page.tsx +73 -73
- package/keycloak-theme/login/pages/webauthn-error/index.ts +3 -3
- package/keycloak-theme/login/pages/webauthn-register/Page.stories.tsx +39 -49
- package/keycloak-theme/login/pages/webauthn-register/Page.tsx +78 -78
- package/keycloak-theme/login/pages/webauthn-register/index.ts +3 -3
- package/keycloak-theme/login/pages/webauthn-register/useScript.tsx +62 -62
- package/keycloak-theme/login/shared/getColorScheme.ts +45 -0
- package/keycloak-theme/login/styleLevelCustomization.tsx +36 -17
- package/package.json +6 -5
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { Button } from "@/components/ui/button";
|
|
2
|
-
import { useKcContext } from "@/login/KcContext";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { assert } from "tsafe/assert";
|
|
5
|
-
import { Template } from "../../components/Template";
|
|
6
|
-
import { UserProfileFormFields } from "../../components/UserProfileFormFields";
|
|
7
|
-
import { useI18n } from "../../i18n";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export function Page() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const { kcContext } = useKcContext();
|
|
14
|
-
assert(kcContext.pageId === "idp-review-user-profile.ftl");
|
|
15
|
-
|
|
16
|
-
const { msg, msgStr } = useI18n();
|
|
17
|
-
|
|
18
|
-
const [isFomSubmittable, setIsFomSubmittable] = useState(false);
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<Template
|
|
22
|
-
displayMessage={kcContext.messagesPerField.exists("global")}
|
|
23
|
-
displayRequiredFields
|
|
24
|
-
headerNode={msg("loginIdpReviewProfileTitle")}
|
|
25
|
-
>
|
|
26
|
-
<form
|
|
27
|
-
id="kc-idp-review-profile-form"
|
|
28
|
-
action={kcContext.url.loginAction}
|
|
29
|
-
method="post"
|
|
30
|
-
className="flex flex-col gap-4"
|
|
31
|
-
>
|
|
32
|
-
<UserProfileFormFields
|
|
33
|
-
onIsFormSubmittableValueChange={setIsFomSubmittable}
|
|
34
|
-
/>
|
|
35
|
-
<div >
|
|
36
|
-
<div id="kc-form-options" >
|
|
37
|
-
<div />
|
|
38
|
-
</div>
|
|
39
|
-
<div id="kc-form-buttons">
|
|
40
|
-
<Button
|
|
41
|
-
className="w-full"
|
|
42
|
-
disabled={!isFomSubmittable}
|
|
43
|
-
type="submit"
|
|
44
|
-
>
|
|
45
|
-
{msgStr("doSubmit")}
|
|
46
|
-
</Button>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</form>
|
|
50
|
-
</Template>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
1
|
+
import { Button } from "@/components/ui/button";
|
|
2
|
+
import { useKcContext } from "@/login/KcContext";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { assert } from "tsafe/assert";
|
|
5
|
+
import { Template } from "../../components/Template";
|
|
6
|
+
import { UserProfileFormFields } from "../../components/UserProfileFormFields";
|
|
7
|
+
import { useI18n } from "../../i18n";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export function Page() {
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const { kcContext } = useKcContext();
|
|
14
|
+
assert(kcContext.pageId === "idp-review-user-profile.ftl");
|
|
15
|
+
|
|
16
|
+
const { msg, msgStr } = useI18n();
|
|
17
|
+
|
|
18
|
+
const [isFomSubmittable, setIsFomSubmittable] = useState(false);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Template
|
|
22
|
+
displayMessage={kcContext.messagesPerField.exists("global")}
|
|
23
|
+
displayRequiredFields
|
|
24
|
+
headerNode={msg("loginIdpReviewProfileTitle")}
|
|
25
|
+
>
|
|
26
|
+
<form
|
|
27
|
+
id="kc-idp-review-profile-form"
|
|
28
|
+
action={kcContext.url.loginAction}
|
|
29
|
+
method="post"
|
|
30
|
+
className="flex flex-col gap-4"
|
|
31
|
+
>
|
|
32
|
+
<UserProfileFormFields
|
|
33
|
+
onIsFormSubmittableValueChange={setIsFomSubmittable}
|
|
34
|
+
/>
|
|
35
|
+
<div >
|
|
36
|
+
<div id="kc-form-options" >
|
|
37
|
+
<div />
|
|
38
|
+
</div>
|
|
39
|
+
<div id="kc-form-buttons">
|
|
40
|
+
<Button
|
|
41
|
+
className="w-full"
|
|
42
|
+
disabled={!isFomSubmittable}
|
|
43
|
+
type="submit"
|
|
44
|
+
>
|
|
45
|
+
{msgStr("doSubmit")}
|
|
46
|
+
</Button>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</form>
|
|
50
|
+
</Template>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Page } from "./Page";
|
|
2
|
-
|
|
3
|
-
export default Page;
|
|
1
|
+
import { Page } from "./Page";
|
|
2
|
+
|
|
3
|
+
export default Page;
|
|
@@ -12,75 +12,65 @@ export default meta;
|
|
|
12
12
|
type Story = StoryObj<typeof meta>;
|
|
13
13
|
|
|
14
14
|
export const Default: Story = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/>
|
|
24
|
-
)
|
|
15
|
+
args: {
|
|
16
|
+
kcContext: {
|
|
17
|
+
messageHeader: "Message header",
|
|
18
|
+
message: {
|
|
19
|
+
summary: "Server info message"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
25
23
|
};
|
|
26
24
|
export const Arabic: Story = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/>
|
|
36
|
-
)
|
|
25
|
+
args: {
|
|
26
|
+
kcContext: {
|
|
27
|
+
locale: {
|
|
28
|
+
currentLanguageTag: "ar",
|
|
29
|
+
rtl: true
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
37
33
|
};
|
|
38
34
|
export const French: Story = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/>
|
|
47
|
-
)
|
|
35
|
+
args: {
|
|
36
|
+
kcContext: {
|
|
37
|
+
locale: {
|
|
38
|
+
currentLanguageTag: "fr"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
48
42
|
};
|
|
49
43
|
|
|
50
44
|
export const WithLinkBack: Story = {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/>
|
|
61
|
-
)
|
|
45
|
+
args: {
|
|
46
|
+
kcContext: {
|
|
47
|
+
messageHeader: "Message header",
|
|
48
|
+
message: {
|
|
49
|
+
summary: "Server message"
|
|
50
|
+
},
|
|
51
|
+
actionUri: undefined
|
|
52
|
+
}
|
|
53
|
+
}
|
|
62
54
|
};
|
|
63
55
|
|
|
64
56
|
export const WithRequiredActions: Story = {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"requiredAction.CUSTOM_ACTION": "Custom action"
|
|
81
|
-
}
|
|
57
|
+
args: {
|
|
58
|
+
kcContext: {
|
|
59
|
+
messageHeader: "Message header",
|
|
60
|
+
message: {
|
|
61
|
+
summary: "Required actions: "
|
|
62
|
+
},
|
|
63
|
+
requiredActions: [
|
|
64
|
+
"CONFIGURE_TOTP",
|
|
65
|
+
"UPDATE_PROFILE",
|
|
66
|
+
"VERIFY_EMAIL",
|
|
67
|
+
"CUSTOM_ACTION"
|
|
68
|
+
],
|
|
69
|
+
"x-keycloakify": {
|
|
70
|
+
messages: {
|
|
71
|
+
"requiredAction.CUSTOM_ACTION": "Custom action"
|
|
82
72
|
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
86
76
|
};
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
import { Alert, AlertDescription } from '@/components/ui/alert';
|
|
3
|
-
import { Button } from '@/components/ui/button';
|
|
4
|
-
import { kcSanitize } from "@keycloakify/login-ui/kcSanitize";
|
|
5
|
-
import { assert } from "tsafe/assert";
|
|
6
|
-
import { Template } from "../../components/Template";
|
|
7
|
-
import { useI18n } from "../../i18n";
|
|
8
|
-
import { useKcContext } from "../../KcContext";
|
|
9
|
-
|
|
10
|
-
export function Page() {
|
|
11
|
-
|
|
12
|
-
const { kcContext } = useKcContext();
|
|
13
|
-
assert(kcContext.pageId === "info.ftl");
|
|
14
|
-
|
|
15
|
-
const { advancedMsgStr, msg } = useI18n();
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<Template
|
|
19
|
-
displayMessage={false}
|
|
20
|
-
headerNode={
|
|
21
|
-
<span
|
|
22
|
-
dangerouslySetInnerHTML={{
|
|
23
|
-
__html: kcSanitize(
|
|
24
|
-
kcContext.messageHeader
|
|
25
|
-
? advancedMsgStr(kcContext.messageHeader)
|
|
26
|
-
: kcContext.message.summary
|
|
27
|
-
)
|
|
28
|
-
}}
|
|
29
|
-
/>
|
|
30
|
-
}
|
|
31
|
-
>
|
|
32
|
-
<Alert variant="info" className="my-3">
|
|
33
|
-
<AlertDescription>
|
|
34
|
-
<p
|
|
35
|
-
dangerouslySetInnerHTML={{
|
|
36
|
-
__html: kcSanitize(
|
|
37
|
-
(() => {
|
|
38
|
-
let html = kcContext.message.summary;
|
|
39
|
-
|
|
40
|
-
if (kcContext.requiredActions) {
|
|
41
|
-
html += "<b>";
|
|
42
|
-
|
|
43
|
-
html += kcContext.requiredActions
|
|
44
|
-
.map(requiredAction =>
|
|
45
|
-
advancedMsgStr(
|
|
46
|
-
`requiredAction.${requiredAction}`
|
|
47
|
-
)
|
|
48
|
-
)
|
|
49
|
-
.join(", ");
|
|
50
|
-
|
|
51
|
-
html += "</b>";
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return html;
|
|
55
|
-
})()
|
|
56
|
-
)
|
|
57
|
-
}}
|
|
58
|
-
/>
|
|
59
|
-
</AlertDescription>
|
|
60
|
-
</Alert>
|
|
61
|
-
|
|
62
|
-
{(() => {
|
|
63
|
-
if (kcContext.skipLink) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (kcContext.pageRedirectUri) {
|
|
68
|
-
return (
|
|
69
|
-
<Button type="button" className="mt-2 flex ms-auto">
|
|
70
|
-
<a href={kcContext.pageRedirectUri}>{msg("backToApplication")}</a>
|
|
71
|
-
</Button>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
if (kcContext.actionUri) {
|
|
75
|
-
return (
|
|
76
|
-
<Button type="button" className="mt-2 flex ms-auto ">
|
|
77
|
-
<a href={kcContext.actionUri}>{msg("proceedWithAction")}</a>
|
|
78
|
-
</Button>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (kcContext.client.baseUrl) {
|
|
83
|
-
return (
|
|
84
|
-
<Button type="button" className="mt-2 flex ms-auto-end">
|
|
85
|
-
<a href={kcContext.client.baseUrl}>{msg("backToApplication")}</a>
|
|
86
|
-
</Button>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
})()}
|
|
90
|
-
</Template>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
1
|
+
|
|
2
|
+
import { Alert, AlertDescription } from '@/components/ui/alert';
|
|
3
|
+
import { Button } from '@/components/ui/button';
|
|
4
|
+
import { kcSanitize } from "@keycloakify/login-ui/kcSanitize";
|
|
5
|
+
import { assert } from "tsafe/assert";
|
|
6
|
+
import { Template } from "../../components/Template";
|
|
7
|
+
import { useI18n } from "../../i18n";
|
|
8
|
+
import { useKcContext } from "../../KcContext";
|
|
9
|
+
|
|
10
|
+
export function Page() {
|
|
11
|
+
|
|
12
|
+
const { kcContext } = useKcContext();
|
|
13
|
+
assert(kcContext.pageId === "info.ftl");
|
|
14
|
+
|
|
15
|
+
const { advancedMsgStr, msg } = useI18n();
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Template
|
|
19
|
+
displayMessage={false}
|
|
20
|
+
headerNode={
|
|
21
|
+
<span
|
|
22
|
+
dangerouslySetInnerHTML={{
|
|
23
|
+
__html: kcSanitize(
|
|
24
|
+
kcContext.messageHeader
|
|
25
|
+
? advancedMsgStr(kcContext.messageHeader)
|
|
26
|
+
: kcContext.message.summary
|
|
27
|
+
)
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
}
|
|
31
|
+
>
|
|
32
|
+
<Alert variant="info" className="my-3">
|
|
33
|
+
<AlertDescription>
|
|
34
|
+
<p
|
|
35
|
+
dangerouslySetInnerHTML={{
|
|
36
|
+
__html: kcSanitize(
|
|
37
|
+
(() => {
|
|
38
|
+
let html = kcContext.message.summary;
|
|
39
|
+
|
|
40
|
+
if (kcContext.requiredActions) {
|
|
41
|
+
html += "<b>";
|
|
42
|
+
|
|
43
|
+
html += kcContext.requiredActions
|
|
44
|
+
.map(requiredAction =>
|
|
45
|
+
advancedMsgStr(
|
|
46
|
+
`requiredAction.${requiredAction}`
|
|
47
|
+
)
|
|
48
|
+
)
|
|
49
|
+
.join(", ");
|
|
50
|
+
|
|
51
|
+
html += "</b>";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return html;
|
|
55
|
+
})()
|
|
56
|
+
)
|
|
57
|
+
}}
|
|
58
|
+
/>
|
|
59
|
+
</AlertDescription>
|
|
60
|
+
</Alert>
|
|
61
|
+
|
|
62
|
+
{(() => {
|
|
63
|
+
if (kcContext.skipLink) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (kcContext.pageRedirectUri) {
|
|
68
|
+
return (
|
|
69
|
+
<Button type="button" className="mt-2 flex ms-auto">
|
|
70
|
+
<a href={kcContext.pageRedirectUri}>{msg("backToApplication")}</a>
|
|
71
|
+
</Button>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
if (kcContext.actionUri) {
|
|
75
|
+
return (
|
|
76
|
+
<Button type="button" className="mt-2 flex ms-auto ">
|
|
77
|
+
<a href={kcContext.actionUri}>{msg("proceedWithAction")}</a>
|
|
78
|
+
</Button>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (kcContext.client.baseUrl) {
|
|
83
|
+
return (
|
|
84
|
+
<Button type="button" className="mt-2 flex ms-auto-end">
|
|
85
|
+
<a href={kcContext.client.baseUrl}>{msg("backToApplication")}</a>
|
|
86
|
+
</Button>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
})()}
|
|
90
|
+
</Template>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -12,23 +12,39 @@ export default meta;
|
|
|
12
12
|
type Story = StoryObj<typeof meta>;
|
|
13
13
|
|
|
14
14
|
export const Default: Story = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
args: {
|
|
16
|
+
kcContext: {
|
|
17
|
+
idpDisplayName: "GitHub",
|
|
18
|
+
url: { loginAction: "/mock-login-action" }
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Arabic: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
kcContext: {
|
|
26
|
+
locale: {
|
|
27
|
+
currentLanguageTag: "ar",
|
|
28
|
+
rtl: true
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export const French: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
kcContext: {
|
|
36
|
+
locale: {
|
|
37
|
+
currentLanguageTag: "fr"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
23
41
|
};
|
|
24
42
|
|
|
25
43
|
export const DifferentProvider: Story = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/>
|
|
33
|
-
)
|
|
44
|
+
args: {
|
|
45
|
+
kcContext: {
|
|
46
|
+
idpDisplayName: "Google",
|
|
47
|
+
url: { loginAction: "/custom-login-action" }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
34
50
|
};
|
|
@@ -1,43 +1,43 @@
|
|
|
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";
|
|
5
|
-
import { Template } from "../../components/Template";
|
|
6
|
-
|
|
7
|
-
export function Page() {
|
|
8
|
-
const { kcContext } = useKcContext();
|
|
9
|
-
assert(kcContext.pageId === "link-idp-action.ftl");
|
|
10
|
-
|
|
11
|
-
const { msg, msgStr } = useI18n();
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<Template
|
|
15
|
-
headerNode={msg("linkIdpActionTitle", kcContext.idpDisplayName)}
|
|
16
|
-
displayMessage={false}
|
|
17
|
-
>
|
|
18
|
-
<div id="kc-link-text">{msg("linkIdpActionMessage", kcContext.idpDisplayName)}</div>
|
|
19
|
-
<form action={kcContext.url.loginAction} method="post">
|
|
20
|
-
<div className="flex flex-col sm:flex-row gap-3 sm:justify-between mt-6">
|
|
21
|
-
<Button
|
|
22
|
-
name="cancel-aia"
|
|
23
|
-
variant="outline"
|
|
24
|
-
className="flex-1"
|
|
25
|
-
id="kc-cancel"
|
|
26
|
-
type="submit"
|
|
27
|
-
>
|
|
28
|
-
{msgStr("doCancel")}
|
|
29
|
-
</Button>
|
|
30
|
-
<Button
|
|
31
|
-
name="continue"
|
|
32
|
-
id="kc-continue"
|
|
33
|
-
type="submit"
|
|
34
|
-
className="flex-1"
|
|
35
|
-
>
|
|
36
|
-
{msgStr("doContinue")}
|
|
37
|
-
</Button>
|
|
38
|
-
</div>
|
|
39
|
-
</form>
|
|
40
|
-
<div className="clearfix" />
|
|
41
|
-
</Template>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
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";
|
|
5
|
+
import { Template } from "../../components/Template";
|
|
6
|
+
|
|
7
|
+
export function Page() {
|
|
8
|
+
const { kcContext } = useKcContext();
|
|
9
|
+
assert(kcContext.pageId === "link-idp-action.ftl");
|
|
10
|
+
|
|
11
|
+
const { msg, msgStr } = useI18n();
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Template
|
|
15
|
+
headerNode={msg("linkIdpActionTitle", kcContext.idpDisplayName)}
|
|
16
|
+
displayMessage={false}
|
|
17
|
+
>
|
|
18
|
+
<div id="kc-link-text">{msg("linkIdpActionMessage", kcContext.idpDisplayName)}</div>
|
|
19
|
+
<form action={kcContext.url.loginAction} method="post">
|
|
20
|
+
<div className="flex flex-col sm:flex-row gap-3 sm:justify-between mt-6">
|
|
21
|
+
<Button
|
|
22
|
+
name="cancel-aia"
|
|
23
|
+
variant="outline"
|
|
24
|
+
className="flex-1"
|
|
25
|
+
id="kc-cancel"
|
|
26
|
+
type="submit"
|
|
27
|
+
>
|
|
28
|
+
{msgStr("doCancel")}
|
|
29
|
+
</Button>
|
|
30
|
+
<Button
|
|
31
|
+
name="continue"
|
|
32
|
+
id="kc-continue"
|
|
33
|
+
type="submit"
|
|
34
|
+
className="flex-1"
|
|
35
|
+
>
|
|
36
|
+
{msgStr("doContinue")}
|
|
37
|
+
</Button>
|
|
38
|
+
</div>
|
|
39
|
+
</form>
|
|
40
|
+
<div className="clearfix" />
|
|
41
|
+
</Template>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Page } from "./Page";
|
|
2
|
-
|
|
3
|
-
export default Page;
|
|
1
|
+
import { Page } from "./Page";
|
|
2
|
+
|
|
3
|
+
export default Page;
|