forked from keycloakify/keycloakify-starter-webpack
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
2,590 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/login/pages/LoginOauth2DeviceVerifyUserCode.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { createKcPageStory } from "../KcPageStory"; | ||
|
||
const { KcPageStory } = createKcPageStory({ pageId: "login-oauth2-device-verify-user-code.ftl" }); | ||
|
||
const meta = { | ||
title: "login/login-oauth2-device-verify-user-code.ftl", | ||
component: KcPageStory | ||
} satisfies Meta<typeof KcPageStory>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
render: () => <KcPageStory /> | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { getKcClsx } from "keycloakify/login/lib/kcClsx"; | ||
import { PageProps } from "keycloakify/login/pages/PageProps"; | ||
import { KcContext } from "../KcContext"; | ||
import type { I18n } from "../i18n"; | ||
import { buttonVariants } from "../../components/ui/button"; | ||
import { Input } from "../../components/ui/input"; | ||
import { cn } from "../../lib/utils"; | ||
export default function LoginOauth2DeviceVerifyUserCode( | ||
props: PageProps<Extract<KcContext, { pageId: "login-oauth2-device-verify-user-code.ftl" }>, I18n> | ||
) { | ||
const { kcContext, i18n, doUseDefaultCss, classes, Template } = props; | ||
const { url } = kcContext; | ||
|
||
const { msg, msgStr } = i18n; | ||
|
||
const { kcClsx } = getKcClsx({ | ||
doUseDefaultCss, | ||
classes | ||
}); | ||
|
||
return ( | ||
<Template | ||
kcContext={kcContext} | ||
i18n={i18n} | ||
doUseDefaultCss={doUseDefaultCss} | ||
classes={classes} | ||
headerNode={msg("oauth2DeviceVerificationTitle")} | ||
> | ||
<form | ||
id="kc-user-verify-device-user-code-form" | ||
className={kcClsx("kcFormClass")} | ||
action={url.oauth2DeviceVerificationAction} | ||
method="post" | ||
> | ||
<div className={kcClsx("kcFormGroupClass")}> | ||
<div className={kcClsx("kcLabelWrapperClass")}> | ||
<label htmlFor="device-user-code" className={kcClsx("kcLabelClass")}> | ||
{msg("verifyOAuth2DeviceUserCode")} | ||
</label> | ||
</div> | ||
|
||
<div className={kcClsx("kcInputWrapperClass")}> | ||
<Input | ||
id="device-user-code" | ||
name="device_user_code" | ||
autoComplete="off" | ||
type="text" | ||
className={kcClsx("kcInputClass")} | ||
autoFocus | ||
/> | ||
</div> | ||
</div> | ||
|
||
<div className={kcClsx("kcFormGroupClass")}> | ||
<div id="kc-form-options" className={kcClsx("kcFormOptionsClass")}> | ||
<div className={kcClsx("kcFormOptionsWrapperClass")}></div> | ||
</div> | ||
|
||
<div id="kc-form-buttons" className={kcClsx("kcFormButtonsClass")}> | ||
<div className={kcClsx("kcFormButtonsWrapperClass")}> | ||
<input | ||
// className={kcClsx("kcButtonClass", "kcButtonPrimaryClass", "kcButtonLargeClass")} | ||
className={cn(buttonVariants(), "w-full")} | ||
type="submit" | ||
value={msgStr("doSubmit")} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</Template> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { createKcPageStory } from "../KcPageStory"; | ||
|
||
const { KcPageStory } = createKcPageStory({ pageId: "login-recovery-authn-code-config.ftl" }); | ||
|
||
const meta = { | ||
title: "login/login-recovery-authn-code-config.ftl", | ||
component: KcPageStory | ||
} satisfies Meta<typeof KcPageStory>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
render: () => <KcPageStory /> | ||
}; | ||
export const WithAppInitiatedAction: Story = { | ||
render: () => ( | ||
<KcPageStory | ||
kcContext={{ | ||
isAppInitiatedAction: true | ||
}} | ||
/> | ||
) | ||
}; |
Oops, something went wrong.