From f9db40d33d831d2b10ce79bedd7004456c9fafe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klemens=20B=C3=B6swirth?= <23529132+kodebach@users.noreply.github.com> Date: Wed, 2 Apr 2025 12:08:37 +0000 Subject: [PATCH] fix: https://github.com/keycloak/keycloak/issues/36012 adapted from https://github.com/keycloak/keycloak/pull/36096 --- src/login/pages/LoginOtp.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/login/pages/LoginOtp.tsx b/src/login/pages/LoginOtp.tsx index a8e3b02a..2d977a79 100644 --- a/src/login/pages/LoginOtp.tsx +++ b/src/login/pages/LoginOtp.tsx @@ -1,4 +1,4 @@ -import { Fragment } from "react"; +import { Fragment, useCallback, useRef } from "react"; import { getKcClsx } from "keycloakify/login/lib/kcClsx"; import { kcSanitize } from "keycloakify/lib/kcSanitize"; import type { PageProps } from "keycloakify/login/pages/PageProps"; @@ -17,6 +17,15 @@ export default function LoginOtp(props: PageProps(null); + + const onSubmitForm = useCallback(() => { + if (loginButtonRef.current !== null) { + loginButtonRef.current.disabled = true; + } + return true; + }, [loginButtonRef]); + return (