diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 6d8ed83..9c66784 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -130,18 +130,18 @@ jobs:
- uses: actions/setup-node@v3.6.0
- run: npx -y -p gh-pages@3.0.0 gh-pages -u "github-actions-bot " -d build
- github_pages_storybook:
- runs-on: ubuntu-latest
- needs:
- - create_github_release
- steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v3.6.0
- - uses: bahmutov/npm-install@v1
- - run: yarn build-keycloak-theme # Only for the assets in public
- - run: yarn build-storybook
- - run: git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${{github.repository}}.git
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - run: npx -y -p gh-pages@3.0.0 gh-pages -u "github-actions-bot " -d storybook-static --dest storybook --add
+# github_pages_storybook:
+# runs-on: ubuntu-latest
+# needs:
+# - create_github_release
+# steps:
+# - uses: actions/checkout@v2
+# - uses: actions/setup-node@v3.6.0
+# - uses: bahmutov/npm-install@v1
+# - run: yarn build-keycloak-theme # Only for the assets in public
+# - run: yarn build-storybook
+# - run: git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${{github.repository}}.git
+# env:
+# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+# - run: npx -y -p gh-pages@3.0.0 gh-pages -u "github-actions-bot " -d storybook-static --dest storybook --add
diff --git a/src/keycloak-theme/Template.stories.tsx b/src/keycloak-theme/Template.stories.tsx
deleted file mode 100644
index d8660ed..0000000
--- a/src/keycloak-theme/Template.stories.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import type {ComponentMeta} from '@storybook/react';
-import KcApp from './KcApp';
-import {template} from '../../.storybook/util'
-
-const bind = template('my-extra-page-1.ftl');
-
-export default {
- title: 'Theme/Template',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-
-export const Default = bind({})
-export const InFrench = bind({locale: {currentLanguageTag: 'fr'}})
-export const RealmDisplayNameIsHtml = bind({
- realm: {
- displayNameHtml: ''
- }
-})
-
-export const NoInternationalization = bind({
- realm: {
- internationalizationEnabled: false,
- }
-})
-
-export const WithGlobalError = bind({
- message: {type: "error", summary: "This is an error"}
-})
diff --git a/src/keycloak-theme/pages/Error.stories.tsx b/src/keycloak-theme/pages/Error.stories.tsx
deleted file mode 100644
index 768a6d1..0000000
--- a/src/keycloak-theme/pages/Error.stories.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import {ComponentMeta} from '@storybook/react';
-import KcApp from '../KcApp';
-import {template} from '../../../.storybook/util'
-
-const bind = template('error.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Notification/Error',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({message: {type: 'error', summary: 'Something went wrong'}})
diff --git a/src/keycloak-theme/pages/Error.tsx b/src/keycloak-theme/pages/Error.tsx
deleted file mode 100644
index b28ff06..0000000
--- a/src/keycloak-theme/pages/Error.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-// copied and adapted from https://github.com/InseeFrLab/keycloakify/blob/main/src/lib/pages/Error.tsx
-import React from "react";
-import type { PageProps } from "keycloakify"
-import type { KcContext } from "../kcContext";
-import type { I18n } from "../i18n";
-
-
-export default function Error(props: PageProps, I18n>) {
- const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
-
- const { message, client } = kcContext;
-
- const { msg } = i18n;
-
- return (
-
- {message.summary}
- {client !== undefined && client.baseUrl !== undefined && (
-
-
- {msg("backToApplication")}
-
-
- )}
-
- }
- />
- );
-}
\ No newline at end of file
diff --git a/src/keycloak-theme/pages/IdpReviewUserProfile.stories.tsx b/src/keycloak-theme/pages/IdpReviewUserProfile.stories.tsx
deleted file mode 100644
index 660216c..0000000
--- a/src/keycloak-theme/pages/IdpReviewUserProfile.stories.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('idp-review-user-profile.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/IDP/Review User Profile',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
-
diff --git a/src/keycloak-theme/pages/IdpReviewUserProfile.tsx b/src/keycloak-theme/pages/IdpReviewUserProfile.tsx
deleted file mode 100644
index 2e4f789..0000000
--- a/src/keycloak-theme/pages/IdpReviewUserProfile.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import React, { useState } from "react";
-import { clsx } from "keycloakify/lib/tools/clsx";
-import { UserProfileFormFields } from "keycloakify/lib/pages/shared/UserProfileCommons";
-import type { PageProps } from "keycloakify";
-import type { KcContext } from "../kcContext";
-import type { I18n } from "../i18n";
-
-export default function IdpReviewUserProfile(props: PageProps, I18n>) {
- const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
-
- const { msg, msgStr } = i18n;
-
- const { url } = kcContext;
-
- const [isFomSubmittable, setIsFomSubmittable] = useState(false);
-
- return (
-
-
-
-
-
- }
- />
- );
-}
\ No newline at end of file
diff --git a/src/keycloak-theme/pages/Info.stories.tsx b/src/keycloak-theme/pages/Info.stories.tsx
deleted file mode 100644
index 4fd483f..0000000
--- a/src/keycloak-theme/pages/Info.stories.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('info.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Notification/Info',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-
-export const Default = bind({
- messageHeader: 'Yo, get this:',
- message: {
- summary: 'You look good today'
- }
-})
-
-export const WithLinkBack = bind({
- messageHeader: 'Yo, get this:',
- message: {
- summary: 'You look good today'
- },
- actionUri: undefined
-})
-
-export const WithRequiredActions = bind({
- messageHeader: 'Yo, get this:',
- message: {
- summary: 'Before you can carry on, you need to do this: '
- },
- requiredActions: ["CONFIGURE_TOTP", "UPDATE_PROFILE", "VERIFY_EMAIL"]
-})
diff --git a/src/keycloak-theme/pages/Info.tsx b/src/keycloak-theme/pages/Info.tsx
deleted file mode 100644
index 5f921d0..0000000
--- a/src/keycloak-theme/pages/Info.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import React from "react";
-import {assert} from "keycloakify/lib/tools/assert";
-import type {PageProps} from "keycloakify";
-import type {KcContext} from "../kcContext";
-import type {I18n} from "../i18n";
-
-export default function Info(props: PageProps, I18n>) {
- const {kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps} = props;
-
- const {msgStr, msg} = i18n;
-
- assert(kcContext.message !== undefined);
-
- const {messageHeader, message, requiredActions, skipLink, pageRedirectUri, actionUri, client} = kcContext;
-
- return (
- {messageHeader}> : <>{message.summary}>}
- formNode={
-
-
- {message.summary}
-
- {requiredActions !== undefined && (
- {requiredActions.map(requiredAction => msgStr(`requiredAction.${requiredAction}` as const)).join(",")}
- )}
-
- {!skipLink && pageRedirectUri !== undefined ? (
-
- {msg("backToApplication")}
-
- ) : actionUri !== undefined ? (
-
- {msg("proceedWithAction")}
-
- ) : (
- client.baseUrl !== undefined && (
-
- {msg("backToApplication")}
-
- )
- )}
-
- }
- />
- );
-}
\ No newline at end of file
diff --git a/src/keycloak-theme/pages/Login.stories.tsx b/src/keycloak-theme/pages/Login.stories.tsx
deleted file mode 100644
index 9cafd82..0000000
--- a/src/keycloak-theme/pages/Login.stories.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { socialProviders, template } from '../../../.storybook/util'
-
-const bind = template('login.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Login/Login',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
-export const WithoutPasswordField = bind({ realm: { password: false } })
-export const WithoutRegistration = bind({ realm: { registrationAllowed: false } })
-export const WithoutRememberMe = bind({ realm: { rememberMe: false } })
-export const WithoutPasswordReset = bind({ realm: { resetPasswordAllowed: false } })
-export const WithEmailAsUsername = bind({ realm: { loginWithEmailAllowed: false } })
-export const WithPresetUsername = bind({ login: { username: 'max.mustermann@mail.com' } })
-export const WithImmutablePresetUsername = bind({
- login: { username: 'max.mustermann@mail.com' },
- usernameEditDisabled: true
-})
-export const WithSocialProviders = bind({ social: { displayInfo: true, providers: socialProviders } })
diff --git a/src/keycloak-theme/pages/LoginConfigTotp.stories.tsx b/src/keycloak-theme/pages/LoginConfigTotp.stories.tsx
deleted file mode 100644
index d798dd2..0000000
--- a/src/keycloak-theme/pages/LoginConfigTotp.stories.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('login-config-totp.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Actions/Configure TOTP',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
-
-export const WithManualSetUp = bind({ mode: 'manual' })
-export const WithError = bind({
- messagesPerField: {
- get: (fieldName: string) => fieldName === 'totp' ? 'Invalid TOTP' : undefined,
- exists: (fieldName: string) => fieldName === 'totp',
- existsError: (fieldName: string) => fieldName === 'totp',
- printIfExists: (fieldName: string, x: T) => fieldName === 'totp' ? x : undefined
- }
-})
-
diff --git a/src/keycloak-theme/pages/LoginConfigTotp.tsx b/src/keycloak-theme/pages/LoginConfigTotp.tsx
deleted file mode 100644
index fc473c9..0000000
--- a/src/keycloak-theme/pages/LoginConfigTotp.tsx
+++ /dev/null
@@ -1,186 +0,0 @@
-import React from "react";
-import {clsx} from "keycloakify/lib/tools/clsx";
-import type {PageProps, KcContextBase} from "keycloakify";
-import type {KcContext} from "../kcContext";
-import type {I18n} from "../i18n";
-
-export default function LoginConfigTotp(props: PageProps, I18n>) {
- const {kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps} = props;
-
- const {url, isAppInitiatedAction, totp, mode, messagesPerField} = kcContext;
-
- const {msg, msgStr} = i18n;
-
- const algToKeyUriAlg: Record = {
- "HmacSHA1": "SHA1",
- "HmacSHA256": "SHA256",
- "HmacSHA512": "SHA512"
- };
-
- return (
-
-
- -
-
{msg("loginTotpStep1")}
-
-
- {totp.policy.supportedApplications.map(app => (
- - {app}
- ))}
-
-
-
- {mode && mode == "manual" ? (
- <>
- -
-
{msg("loginTotpManualStep2")}
-
- {totp.totpSecretEncoded}
-
-
-
- {msg("loginTotpScanBarcode")}
-
-
-
- -
-
{msg("loginTotpManualStep3")}
-
-
- -
- {msg("loginTotpType")}: {msg(`loginTotp.${totp.policy.type}`)}
-
- -
- {msg("loginTotpAlgorithm")}: {algToKeyUriAlg?.[totp.policy.algorithm] ?? totp.policy.algorithm}
-
- -
- {msg("loginTotpDigits")}: {totp.policy.digits}
-
- {totp.policy.type === "totp" ? (
- -
- {msg("loginTotpInterval")}: {totp.policy.period}
-
- ) : (
- -
- {msg("loginTotpCounter")}: {totp.policy.initialCounter}
-
- )}
-
-
-
- >
- ) : (
-
- {msg("loginTotpStep2")}
-
-
-
-
- {msg("loginTotpUnableToScan")}
-
-
-
- )}
-
- {msg("loginTotpStep3")}
- {msg("loginTotpStep3DeviceName")}
-
-
-
-
- >
- }
- />
- );
-}
\ No newline at end of file
diff --git a/src/keycloak-theme/pages/LoginIdpLinkConfirm.stories.tsx b/src/keycloak-theme/pages/LoginIdpLinkConfirm.stories.tsx
deleted file mode 100644
index 75617bb..0000000
--- a/src/keycloak-theme/pages/LoginIdpLinkConfirm.stories.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('login-idp-link-confirm.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/IDP/Confirm Link',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
-
diff --git a/src/keycloak-theme/pages/LoginIdpLinkConfirm.tsx b/src/keycloak-theme/pages/LoginIdpLinkConfirm.tsx
deleted file mode 100644
index 66fca26..0000000
--- a/src/keycloak-theme/pages/LoginIdpLinkConfirm.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import React from "react";
-import {clsx} from "keycloakify/lib/tools/clsx";
-import type {PageProps} from "keycloakify";
-import type {KcContext} from "../kcContext";
-import type {I18n} from "../i18n";
-
-export default function LoginIdpLinkConfirm(props: PageProps, I18n>) {
- const {kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps} = props;
-
- const {url, idpAlias} = kcContext;
-
- const {msg} = i18n;
-
- return (
-
-
-
-
-
-
- }
- />
- );
-}
\ No newline at end of file
diff --git a/src/keycloak-theme/pages/LoginIdpLinkEmail.stories.tsx b/src/keycloak-theme/pages/LoginIdpLinkEmail.stories.tsx
deleted file mode 100644
index 1d03385..0000000
--- a/src/keycloak-theme/pages/LoginIdpLinkEmail.stories.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('login-idp-link-email.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/IDP/Confirm Email',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
-
diff --git a/src/keycloak-theme/pages/LoginIdpLinkEmail.tsx b/src/keycloak-theme/pages/LoginIdpLinkEmail.tsx
deleted file mode 100644
index f73aead..0000000
--- a/src/keycloak-theme/pages/LoginIdpLinkEmail.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import React from "react";
-import type {PageProps} from "keycloakify";
-import type {KcContext} from "../kcContext";
-import type {I18n} from "../i18n";
-
-export default function LoginIdpLinkEmail(props: PageProps, I18n>) {
- const {kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps} = props;
-
- const {url, realm, brokerContext, idpAlias} = kcContext;
-
- const {msg} = i18n;
-
- return (
-
-
- {msg("emailLinkIdp1", idpAlias, brokerContext.username, realm.displayName)}
-
-
- {msg("emailLinkIdp2")} {msg("doClickHere")} {msg("emailLinkIdp3")}
-
-
- {msg("emailLinkIdp4")} {msg("doClickHere")} {msg("emailLinkIdp5")}
-
- >
- }
- />
- );
-}
\ No newline at end of file
diff --git a/src/keycloak-theme/pages/LoginOtp.stories.tsx b/src/keycloak-theme/pages/LoginOtp.stories.tsx
deleted file mode 100644
index f674379..0000000
--- a/src/keycloak-theme/pages/LoginOtp.stories.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('login-otp.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Login/OTP',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
diff --git a/src/keycloak-theme/pages/LoginOtp.tsx b/src/keycloak-theme/pages/LoginOtp.tsx
deleted file mode 100644
index 64bac17..0000000
--- a/src/keycloak-theme/pages/LoginOtp.tsx
+++ /dev/null
@@ -1,114 +0,0 @@
-import React, { useEffect } from "react";
-import { headInsert } from "keycloakify/lib/tools/headInsert";
-import { pathJoin } from "keycloakify/bin/tools/pathJoin";
-import { clsx } from "keycloakify/lib/tools/clsx";
-import type { PageProps } from "keycloakify";
-import type { KcContext } from "../kcContext";
-import type { I18n } from "../i18n";
-
-export default function LoginOtp(props: PageProps, I18n>) {
- const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
-
- const { otpLogin, url } = kcContext;
-
- const { msg, msgStr } = i18n;
-
- useEffect(() => {
- let isCleanedUp = false;
-
- headInsert({
- "type": "javascript",
- "src": pathJoin(kcContext.url.resourcesCommonPath, "node_modules/jquery/dist/jquery.min.js")
- }).then(() => {
- if (isCleanedUp) return;
-
- evaluateInlineScript();
- });
-
- return () => {
- isCleanedUp = true;
- };
- }, []);
-
- return (
-
- {otpLogin.userOtpCredentials.length > 1 && (
-
-
- {otpLogin.userOtpCredentials.map(otpCredential => (
-
-
-
-
-
{otpCredential.userLabel}
-
-
- ))}
-
-
- )}
-
-
-
-
-
-
-
-
-
-
-
-
- }
- />
- );
-}
-
-declare const $: any;
-
-function evaluateInlineScript() {
- $(document).ready(function () {
- // Card Single Select
- $(".card-pf-view-single-select").click(function (this: any) {
- if ($(this).hasClass("active")) {
- $(this).removeClass("active");
- $(this).children().removeAttr("name");
- } else {
- $(".card-pf-view-single-select").removeClass("active");
- $(".card-pf-view-single-select").children().removeAttr("name");
- $(this).addClass("active");
- $(this).children().attr("name", "selectedCredentialId");
- }
- });
-
- var defaultCred = $(".card-pf-view-single-select")[0];
- if (defaultCred) {
- defaultCred.click();
- }
- });
-}
\ No newline at end of file
diff --git a/src/keycloak-theme/pages/LoginPageExpired.stories.tsx b/src/keycloak-theme/pages/LoginPageExpired.stories.tsx
deleted file mode 100644
index f5de885..0000000
--- a/src/keycloak-theme/pages/LoginPageExpired.stories.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('login-page-expired.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Login/Login Page Expired',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
diff --git a/src/keycloak-theme/pages/LoginPageExpired.tsx b/src/keycloak-theme/pages/LoginPageExpired.tsx
deleted file mode 100644
index e44811b..0000000
--- a/src/keycloak-theme/pages/LoginPageExpired.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import React from "react";
-import type { PageProps } from "keycloakify";
-import type { KcContext } from "../kcContext";
-import type { I18n } from "../i18n";
-
-export default function LoginPageExpired(props: PageProps, I18n>) {
- const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
-
- const { url } = kcContext;
-
- const { msg } = i18n;
-
- return (
-
-
- {msg("pageExpiredMsg1")}
-
- {msg("doClickHere")}
- {" "}
- .
- {msg("pageExpiredMsg2")}{" "}
-
- {msg("doClickHere")}
- {" "}
- .
-
- >
- }
- />
- );
-}
\ No newline at end of file
diff --git a/src/keycloak-theme/pages/LoginPassword.stories.tsx b/src/keycloak-theme/pages/LoginPassword.stories.tsx
deleted file mode 100644
index 5106dfc..0000000
--- a/src/keycloak-theme/pages/LoginPassword.stories.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('login-password.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Login/Password',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
diff --git a/src/keycloak-theme/pages/LoginPassword.tsx b/src/keycloak-theme/pages/LoginPassword.tsx
deleted file mode 100644
index ff3798e..0000000
--- a/src/keycloak-theme/pages/LoginPassword.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-import React, { useState } from "react";
-import { clsx } from "keycloakify/lib/tools/clsx";
-import { useConstCallback } from "keycloakify/lib/tools/useConstCallback";
-import type { FormEventHandler } from "react";
-import type { PageProps } from "keycloakify";
-import type { KcContext } from "../kcContext";
-import type { I18n } from "../i18n";
-
-export default function LoginPassword(props: PageProps, I18n>) {
- const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
-
- const { realm, url, login } = kcContext;
-
- const { msg, msgStr } = i18n;
-
- const [isLoginButtonDisabled, setIsLoginButtonDisabled] = useState(false);
-
- const onSubmit = useConstCallback>(e => {
- e.preventDefault();
-
- setIsLoginButtonDisabled(true);
-
- const formElement = e.target as HTMLFormElement;
-
- formElement.submit();
- });
-
- return (
-
-
-
- }
- />
- );
-}
\ No newline at end of file
diff --git a/src/keycloak-theme/pages/LoginResetPassword.stories.tsx b/src/keycloak-theme/pages/LoginResetPassword.stories.tsx
deleted file mode 100644
index c417dd8..0000000
--- a/src/keycloak-theme/pages/LoginResetPassword.stories.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('login-reset-password.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Login/Reset Password',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
-export const WithEmailAsUsername = bind({ realm: { loginWithEmailAllowed: true, registrationEmailAsUsername: true } })
diff --git a/src/keycloak-theme/pages/LoginResetPassword.tsx b/src/keycloak-theme/pages/LoginResetPassword.tsx
deleted file mode 100644
index ddeea69..0000000
--- a/src/keycloak-theme/pages/LoginResetPassword.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import React from "react";
-import { clsx } from "keycloakify/lib/tools/clsx";
-import type { PageProps } from "keycloakify/lib/KcProps";
-import type { KcContext } from "../kcContext";
-import type { I18n } from "../i18n";
-
-export default function LoginResetPassword(props: PageProps, I18n>) {
- const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
-
- const { url, realm, auth } = kcContext;
-
- const { msg, msgStr } = i18n;
-
- return (
-
-
-
-
-
-
-
-
-
-
-
- }
- infoNode={msg("emailInstruction")}
- />
- );
-}
\ No newline at end of file
diff --git a/src/keycloak-theme/pages/LoginUpdatePassword.stories.tsx b/src/keycloak-theme/pages/LoginUpdatePassword.stories.tsx
deleted file mode 100644
index 91f2d7d..0000000
--- a/src/keycloak-theme/pages/LoginUpdatePassword.stories.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('login-update-password.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Actions/Update Password',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
diff --git a/src/keycloak-theme/pages/LoginUpdatePassword.tsx b/src/keycloak-theme/pages/LoginUpdatePassword.tsx
deleted file mode 100644
index d7d375c..0000000
--- a/src/keycloak-theme/pages/LoginUpdatePassword.tsx
+++ /dev/null
@@ -1,117 +0,0 @@
-import React from "react";
-import { clsx } from "keycloakify/lib/tools/clsx";
-import type { PageProps } from "keycloakify/lib/KcProps";
-import type { KcContext } from "../kcContext";
-import type { I18n } from "../i18n";
-
-export default function LoginUpdatePassword(props: PageProps, I18n>) {
- const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
-
- const { msg, msgStr } = i18n;
-
- const { url, messagesPerField, isAppInitiatedAction, username } = kcContext;
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- />
- );
-}
\ No newline at end of file
diff --git a/src/keycloak-theme/pages/LoginUsername.stories.tsx b/src/keycloak-theme/pages/LoginUsername.stories.tsx
deleted file mode 100644
index 21e63c0..0000000
--- a/src/keycloak-theme/pages/LoginUsername.stories.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('login-username.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Login/Username',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
-export const WithEmailAsUsername = bind({ realm: { loginWithEmailAllowed: true, registrationEmailAsUsername: true } })
diff --git a/src/keycloak-theme/pages/LoginUsername.tsx b/src/keycloak-theme/pages/LoginUsername.tsx
deleted file mode 100644
index 7ea5e0a..0000000
--- a/src/keycloak-theme/pages/LoginUsername.tsx
+++ /dev/null
@@ -1,158 +0,0 @@
-import React, { useState } from "react";
-import { clsx } from "keycloakify/lib/tools/clsx";
-import { useConstCallback } from "keycloakify/lib/tools/useConstCallback";
-import type { FormEventHandler } from "react";
-import type { PageProps } from "keycloakify";
-import type { KcContext } from "../kcContext";
-import type { I18n } from "../i18n";
-
-export default function LoginUsername(props: PageProps, I18n>) {
- const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
-
- const { social, realm, url, usernameHidden, login, registrationDisabled } = kcContext;
-
- const { msg, msgStr } = i18n;
-
- const [isLoginButtonDisabled, setIsLoginButtonDisabled] = useState(false);
-
- const onSubmit = useConstCallback>(e => {
- e.preventDefault();
-
- setIsLoginButtonDisabled(true);
-
- const formElement = e.target as HTMLFormElement;
-
- //NOTE: Even if we login with email Keycloak expect username and password in
- //the POST request.
- formElement.querySelector("input[name='email']")?.setAttribute("name", "username");
-
- formElement.submit();
- });
-
- return (
-
-
- {realm.password && social.providers !== undefined && (
-
-
4 && kcProps.kcFormSocialAccountDoubleListClass
- )}
- >
- {social.providers.map(p => (
- -
-
- {p.displayName}
-
-
- ))}
-
-
- )}
-
- }
- infoNode={
- realm.password &&
- realm.registrationAllowed &&
- !registrationDisabled && (
-
- )
- }
- />
- );
-}
diff --git a/src/keycloak-theme/pages/LoginVerifyEmail.stories.tsx b/src/keycloak-theme/pages/LoginVerifyEmail.stories.tsx
deleted file mode 100644
index 2bc48a1..0000000
--- a/src/keycloak-theme/pages/LoginVerifyEmail.stories.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('login-verify-email.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Login/Verify Email',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
diff --git a/src/keycloak-theme/pages/LoginVerifyEmail.tsx b/src/keycloak-theme/pages/LoginVerifyEmail.tsx
deleted file mode 100644
index 513ef3a..0000000
--- a/src/keycloak-theme/pages/LoginVerifyEmail.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import React from "react";
-import type { PageProps } from "keycloakify";
-import type { KcContext } from "../kcContext";
-import type { I18n } from "../i18n";
-
-export default function LoginVerifyEmail(props: PageProps, I18n>) {
- const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
-
- const { msg } = i18n;
-
- const { url, user } = kcContext;
-
- return (
-
- {msg("emailVerifyInstruction1", user?.email)}
-
- {msg("emailVerifyInstruction2")}
-
- {msg("doClickHere")}
-
- {msg("emailVerifyInstruction3")}
-
- >
- }
- />
- );
-}
diff --git a/src/keycloak-theme/pages/LogoutConfirm.stories.tsx b/src/keycloak-theme/pages/LogoutConfirm.stories.tsx
deleted file mode 100644
index e8fd2e5..0000000
--- a/src/keycloak-theme/pages/LogoutConfirm.stories.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('logout-confirm.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Login/Logout Confirmation',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
diff --git a/src/keycloak-theme/pages/LogoutConfirm.tsx b/src/keycloak-theme/pages/LogoutConfirm.tsx
deleted file mode 100644
index 5347f64..0000000
--- a/src/keycloak-theme/pages/LogoutConfirm.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-import React from "react";
-import { clsx } from "keycloakify/lib/tools/clsx";
-import type { PageProps } from "keycloakify/lib/KcProps";
-import type { KcContext } from "../kcContext";
-import type { I18n } from "../i18n";
-
-export default function LogoutConfirm(props: PageProps, I18n>) {
- const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
-
- const { url, client, logoutConfirm } = kcContext;
-
- const { msg, msgStr } = i18n;
-
- return (
-
-
-
{msg("logoutConfirmHeader")}
-
-
- {!logoutConfirm.skipLink && client.baseUrl && (
-
-
-
- )}
-
-
- >
- }
- />
- );
-}
diff --git a/src/keycloak-theme/pages/MyExtraPage1.stories.tsx b/src/keycloak-theme/pages/MyExtraPage1.stories.tsx
deleted file mode 100644
index d1e5055..0000000
--- a/src/keycloak-theme/pages/MyExtraPage1.stories.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('my-extra-page-1.ftl')
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Custom/My Extra Page 1',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
diff --git a/src/keycloak-theme/pages/MyExtraPage2.stories.tsx b/src/keycloak-theme/pages/MyExtraPage2.stories.tsx
deleted file mode 100644
index 462ba7a..0000000
--- a/src/keycloak-theme/pages/MyExtraPage2.stories.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('my-extra-page-2.ftl')
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Custom/My Extra Page 2',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
-
-export const WithCustomValue = bind({ someCustomValue: 'Foo Bar Baz' })
diff --git a/src/keycloak-theme/pages/Register.stories.tsx b/src/keycloak-theme/pages/Register.stories.tsx
deleted file mode 100644
index ddc1872..0000000
--- a/src/keycloak-theme/pages/Register.stories.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('register.ftl')
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Register/Legacy',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
-
-export const WithFieldError = bind({
- register: {
- formData: {
- email: 'max.mustermann@mail.com'
- }
- },
- messagesPerField: {
- existsError: (fieldName: string) => fieldName === "email",
- exists: (fieldName: string) => fieldName === "email",
- get: (fieldName: string) => fieldName === "email" ? "I don't like your email address" : undefined,
- printIfExists: (fieldName: string, x: T) => fieldName === "email" ? x : undefined,
- }
-})
-
-export const WithEmailAsUsername = bind({
- realm: { registrationEmailAsUsername: true }
-})
-
-export const WithoutPassword = bind({
- passwordRequired: false
-})
-
-export const WithRecaptcha = bind({
- recaptchaRequired: true,
- recaptchaSiteKey: 'foobar'
-})
-
-export const WithPresets = bind({
- register: {
- formData: {
- firstName: 'Max',
- lastName: 'Mustermann',
- email: 'max.mustermann@mail.com',
- username: 'max.mustermann'
- }
- }
-})
\ No newline at end of file
diff --git a/src/keycloak-theme/pages/RegisterUserProfile.stories.tsx b/src/keycloak-theme/pages/RegisterUserProfile.stories.tsx
deleted file mode 100644
index adc6685..0000000
--- a/src/keycloak-theme/pages/RegisterUserProfile.stories.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('register-user-profile.ftl')
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Register/Modern',
- component: KcApp,
- parameters: { layout: 'fullscreen' },
-} as ComponentMeta;
-
-export const Default = bind({})
-
-/*
-export const WithFieldError = bind({
- profile: {
- attributes: [
- {
- name: "email",
- value: "max.mustermann@mail.com",
- }
- ]
- }
-})
-
-export const WithPresets = bind({
- profile: {
- attributes: [
- {
- name: "username",
- value: "max.mustermann"
- },
- {
- name: "email",
- value: "max.mustermann@gmail.com",
- },
- {
- name: "firstName",
- required: false,
- value: "Max"
- },
- {
- name: "lastName",
- required: false,
- value: "Mustermann"
- }
- ]
- }
-})
-
-export const WithImmutablePresets = bind({
- profile: {
- attributes: [
- {
- name: "username",
- value: "max.mustermann",
- readOnly: true,
- },
- {
- name: "email",
- value: "max.mustermann@gmail.com",
- readOnly: true,
- },
- {
- name: "firstName",
- required: true,
- value: "Max",
- readOnly: true,
- },
- {
- name: "lastName",
- required: true,
- value: "Mustermann",
- readOnly: true,
- }
- ]
- }
-})
-
-*/
\ No newline at end of file
diff --git a/src/keycloak-theme/pages/Terms.stories.tsx b/src/keycloak-theme/pages/Terms.stories.tsx
deleted file mode 100644
index 28ff76c..0000000
--- a/src/keycloak-theme/pages/Terms.stories.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('terms.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Actions/Terms',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
diff --git a/src/keycloak-theme/pages/UpdateUserProfile.stories.tsx b/src/keycloak-theme/pages/UpdateUserProfile.stories.tsx
deleted file mode 100644
index 8057558..0000000
--- a/src/keycloak-theme/pages/UpdateUserProfile.stories.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('update-user-profile.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Actions/Update User Profile',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
diff --git a/src/keycloak-theme/pages/UpdateUserProfile.tsx b/src/keycloak-theme/pages/UpdateUserProfile.tsx
deleted file mode 100644
index 6bfb1e2..0000000
--- a/src/keycloak-theme/pages/UpdateUserProfile.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import React, { useState } from "react";
-import { clsx } from "keycloakify/lib/tools/clsx";
-import { UserProfileFormFields } from "keycloakify/lib/pages/shared/UserProfileCommons";
-import type { PageProps } from "keycloakify/lib/KcProps";
-import type { KcContext } from "../kcContext";
-import type { I18n } from "../i18n";
-
-export default function UpdateUserProfile(props: PageProps, I18n>) {
- const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
-
- const { msg, msgStr } = i18n;
-
- const { url, isAppInitiatedAction } = kcContext;
-
- const [isFomSubmittable, setIsFomSubmittable] = useState(false);
-
- return (
-
-
-
-
-
- }
- />
- );
-}
diff --git a/src/keycloak-theme/pages/WebauthnAuthenticate.stories.tsx b/src/keycloak-theme/pages/WebauthnAuthenticate.stories.tsx
deleted file mode 100644
index 62a84ee..0000000
--- a/src/keycloak-theme/pages/WebauthnAuthenticate.stories.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ComponentMeta } from '@storybook/react';
-import KcApp from '../KcApp';
-import { template } from '../../../.storybook/util'
-
-const bind = template('webauthn-authenticate.ftl');
-
-export default {
- kind: 'Page',
- title: 'Theme/Pages/Login/Webauthn',
- component: KcApp,
- parameters: {
- layout: 'fullscreen',
- },
-} as ComponentMeta;
-
-export const Default = bind({})
diff --git a/src/keycloak-theme/pages/WebauthnAuthenticate.tsx b/src/keycloak-theme/pages/WebauthnAuthenticate.tsx
deleted file mode 100644
index fd14dc8..0000000
--- a/src/keycloak-theme/pages/WebauthnAuthenticate.tsx
+++ /dev/null
@@ -1,193 +0,0 @@
-import React, { useRef, useState } from "react";
-import { clsx } from "keycloakify/lib/tools/clsx";
-import type { MessageKeyBase } from "keycloakify/lib/i18n";
-import { base64url } from "rfc4648";
-import { useConstCallback } from "keycloakify/lib/tools/useConstCallback";
-import type { PageProps } from "keycloakify/lib/KcProps";
-import type { KcContext } from "../kcContext";
-import type { I18n } from "../i18n";
-
-export default function WebauthnAuthenticate(props: PageProps, I18n>) {
- const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
-
- const { url } = kcContext;
-
- const { msg, msgStr } = i18n;
-
- const { authenticators, challenge, shouldDisplayAuthenticators, userVerification, rpId } = kcContext;
- const createTimeout = Number(kcContext.createTimeout);
- const isUserIdentified = kcContext.isUserIdentified == "true";
-
- const webAuthnAuthenticate = useConstCallback(async () => {
- if (!isUserIdentified) {
- return;
- }
- const allowCredentials = authenticators.authenticators.map(
- authenticator =>
- ({
- id: base64url.parse(authenticator.credentialId, { loose: true }),
- type: "public-key"
- } as PublicKeyCredentialDescriptor)
- );
- // Check if WebAuthn is supported by this browser
- if (!window.PublicKeyCredential) {
- setError(msgStr("webauthn-unsupported-browser-text"));
- submitForm();
- return;
- }
-
- const publicKey: PublicKeyCredentialRequestOptions = {
- rpId,
- challenge: base64url.parse(challenge, { loose: true })
- };
-
- if (createTimeout !== 0) {
- publicKey.timeout = createTimeout * 1000;
- }
-
- if (allowCredentials.length) {
- publicKey.allowCredentials = allowCredentials;
- }
-
- if (userVerification !== "not specified") {
- publicKey.userVerification = userVerification;
- }
-
- try {
- const resultRaw = await navigator.credentials.get({ publicKey });
- if (!resultRaw || resultRaw.type != "public-key") return;
- const result = resultRaw as PublicKeyCredential;
- if (!("authenticatorData" in result.response)) return;
- const response = result.response as AuthenticatorAssertionResponse;
- const clientDataJSON = response.clientDataJSON;
- const authenticatorData = response.authenticatorData;
- const signature = response.signature;
-
- setClientDataJSON(base64url.stringify(new Uint8Array(clientDataJSON), { pad: false }));
- setAuthenticatorData(base64url.stringify(new Uint8Array(authenticatorData), { pad: false }));
- setSignature(base64url.stringify(new Uint8Array(signature), { pad: false }));
- setCredentialId(result.id);
- setUserHandle(base64url.stringify(new Uint8Array(response.userHandle!), { pad: false }));
- submitForm();
- } catch (err) {
- setError(String(err));
- submitForm();
- }
- });
-
- const webAuthForm = useRef(null);
- const submitForm = useConstCallback(() => {
- webAuthForm.current!.submit();
- });
-
- const [clientDataJSON, setClientDataJSON] = useState("");
- const [authenticatorData, setAuthenticatorData] = useState("");
- const [signature, setSignature] = useState("");
- const [credentialId, setCredentialId] = useState("");
- const [userHandle, setUserHandle] = useState("");
- const [error, setError] = useState("");
-
- return (
-
-
-
- {authenticators &&
- (() => (
-
- ))()}
- {authenticators &&
- shouldDisplayAuthenticators &&
- (() => (
- <>
- {authenticators.authenticators.length > 1 && (
-
{msg("webauthn-available-authenticators")}
- )}
-
- {authenticators.authenticators.map(authenticator => (
-
-
-
-
-
-
- {authenticator.label}
-
-
- {authenticator.transports && authenticator.transports.displayNameProperties.length && (
-
- {authenticator.transports.displayNameProperties.map(
- (transport: MessageKeyBase, index: number) => (
- <>
- {msg(transport)}
- {index < authenticator.transports.displayNameProperties.length - 1 && (
- {", "}
- )}
- >
- )
- )}
-
- )}
-
-
- {msg("webauthn-createdAt-label")}
- {authenticator.createdAt}
-
-
-
-
- ))}
-
- >
- ))()}
-
-
-
-
-
- }
- />
- );
-}