diff --git a/src/login/kcContext/KcContext.ts b/src/login/kcContext/KcContext.ts index 15146652..86bc68cf 100644 --- a/src/login/kcContext/KcContext.ts +++ b/src/login/kcContext/KcContext.ts @@ -329,9 +329,6 @@ export declare namespace KcContext { social: { displayInfo: boolean; }; - login: { - password?: string; - }; }; export type WebauthnAuthenticate = Common & { diff --git a/src/login/pages/Login.tsx b/src/login/pages/Login.tsx index e540d03b..0944e706 100644 --- a/src/login/pages/Login.tsx +++ b/src/login/pages/Login.tsx @@ -5,7 +5,6 @@ import type { PageProps } from "keycloakify/login/pages/PageProps"; import { useGetClassName } from "keycloakify/login/lib/useGetClassName"; import type { KcContext } from "../kcContext"; import type { I18n } from "../i18n"; -import type { ClassKey } from "keycloakify/login/TemplateProps"; export default function Login(props: PageProps, I18n>) { const { kcContext, i18n, doUseDefaultCss, Template, classes } = props; @@ -194,7 +193,12 @@ export default function Login(props: PageProps string; i18n: I18n; passwordInputId: string; children: JSX.Element }) { +function PasswordWrapper(props: { + getClassName: ReturnType["getClassName"]; + i18n: I18n; + passwordInputId: string; + children: JSX.Element; +}) { const { getClassName, i18n, passwordInputId, children } = props; const { msgStr } = i18n; diff --git a/src/login/pages/LoginPassword.tsx b/src/login/pages/LoginPassword.tsx index 8d5e0596..1880494d 100644 --- a/src/login/pages/LoginPassword.tsx +++ b/src/login/pages/LoginPassword.tsx @@ -1,7 +1,6 @@ -import { useState } from "react"; +import { useState, useEffect, useReducer } from "react"; import { clsx } from "keycloakify/tools/clsx"; -import { useConstCallback } from "keycloakify/tools/useConstCallback"; -import type { FormEventHandler } from "react"; +import { assert } from "tsafe/assert"; import type { PageProps } from "keycloakify/login/pages/PageProps"; import { useGetClassName } from "keycloakify/login/lib/useGetClassName"; import type { KcContext } from "../kcContext"; @@ -15,42 +14,53 @@ export default function LoginPassword(props: PageProps>(e => { - e.preventDefault(); - - setIsLoginButtonDisabled(true); - - const formElement = e.target as HTMLFormElement; - - formElement.submit(); - }); - return ( -