Replies: 3 comments 6 replies
-
That's great, @nima70! Thanks a lot for sharing. I'll definitely share the video. The video is clear and well-documented. You say a lot of good things about the projects, and I really appreciate that. One last recommendation—this isn't specific to your current video, but something to consider in general: I suggest using Vite instead of Webpack. Vite is much faster, you won't experience such long loading times with it. Additionally, Webpack’s setup tends to be more cumbersome. The reason we support Webpack is to help existing projects integrate Keycloakify without having to migrate to Vite. But for new projects, Vite is the preferred option. Vite also provides a post-build option, which power users like yourself might want to leverage. Unfortunately, there's no equivalent for Webpack at the moment. Anyway, thanks again for sharing this! Let me know your thoughts. |
Beta Was this translation helpful? Give feedback.
-
While improving the test coverage, I noticed something a bit strange. I don't believe this is the expected behavior. Should I go ahead and fix it. Here is the updated storybook: import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
import { createKcPageStory } from "../KcPageStory";
const { KcPageStory } = createKcPageStory({ pageId: "code.ftl" });
const meta = {
title: "login/code.ftl",
component: KcPageStory
} satisfies Meta<typeof KcPageStory>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
render: () => <KcPageStory />
};
export const WithErrorCode: Story = {
render: () => (
<KcPageStory
kcContext={{
code: {
success: false,
error: "Failed to generate code"
}
}}
/>
)
};
export const WithFrenchLanguage: Story = {
render: () => (
<KcPageStory
kcContext={{
locale: {
currentLanguageTag: "fr"
},
code: {
success: true,
code: "XYZ789"
}
}}
/>
)
};
export const WithHtmlErrorMessage: Story = {
render: () => (
<KcPageStory
kcContext={{
code: {
success: false,
error: "Something went wrong. <a href='https://example.com'>Try again</a>"
}
}}
/>
)
};
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback. I added this solution to my pull request: import { getKcClsx } from "keycloakify/login/lib/kcClsx";
import type { PageProps } from "keycloakify/login/pages/PageProps";
import type { KcContext } from "../KcContext";
import type { I18n } from "../i18n";
import { kcSanitize } from "keycloakify/lib/kcSanitize";
export default function Code(props: PageProps<Extract<KcContext, { pageId: "code.ftl" }>, I18n>) {
const { kcContext, i18n, doUseDefaultCss, Template, classes } = props;
const { kcClsx } = getKcClsx({
doUseDefaultCss,
classes
});
const { code } = kcContext;
const { msg } = i18n;
return (
<Template
kcContext={kcContext}
i18n={i18n}
doUseDefaultCss={doUseDefaultCss}
classes={classes}
headerNode={code.success ? msg("codeSuccessTitle") : msg("codeErrorTitle", code.error)}
>
<div id="kc-code">
{code.success ? (
<>
<p>{msg("copyCodeInstruction")}</p>
<input id="code" className={kcClsx("kcTextareaClass")} defaultValue={code.code} />
</>
) : (
code.error && (
<p
id="error"
dangerouslySetInnerHTML={{
__html: kcSanitize(code.error)
}}
/>
)
)}
</div>
</Template>
);
}
|
Beta Was this translation helpful? Give feedback.
-
I hope you're all doing well. I've recently created a YouTube video showcasing the power of Keycloakify for customizing Keycloak themes, and I’d love to get your support in sharing it with others who could benefit from this amazing tool!
🔑 What’s the Video About? In the video, I cover why using Keycloakify makes customizing Keycloak themes faster and easier, compared to manual approaches with Freemaker and CSS. I believe this video can be a helpful resource for those just getting started with Keycloakify or looking for a more efficient way to handle their custom themes.
🎨 Video Link:
https://youtu.be/xmQ5ULhF1Dk
✨ How You Can Help: I’d be super grateful if you could:
Watch the video and share your thoughts! Any feedback is appreciated.
Share the video with others who might find it helpful.
Give it a like or leave a comment if you think it could help the community grow.
📚 Check Out My MindMeister Map: I’ve also created a MindMeister mindmap to summarize the concepts covered in the video. You can check it out here:
https://www.mindmeister.com/3420207844/keycloakify-security-by-nima-shokouhfar
👨💻 About Me:
I’m an active developer and Keycloakify enthusiast, currently working as a freelancer specializing in Keycloak, React, and Storybook. If anyone needs help with customization or has any questions about Keycloakify, feel free to reach out to me on Upwork:
https://www.upwork.com/freelancers/nimas12
Thanks in advance for your support! Together, we can make the Keycloakify community even stronger. 🙌
Looking forward to hearing your thoughts!
Best regards,
Nima Shokouhfar
Beta Was this translation helpful? Give feedback.
All reactions