@@ -183,6 +183,7 @@ const PasswordInputForm = ({
183183 < input type = "hidden" value = { userNameValue } id = "username" name = "username" />
184184 < input type = "hidden" value = { csrfToken } id = "_token" name = "_token" />
185185 < input type = "hidden" value = "password" id = "flow" name = "flow" />
186+ < input type = "hidden" value = { loginAttempts ?? 0 } name = "login_attempts" />
186187 { shouldShowCaptcha ( ) && captchaPublicKey &&
187188 < Turnstile
188189 className = { styles . turnstile }
@@ -214,7 +215,8 @@ const OTPInputForm = ({
214215 shouldShowCaptcha,
215216 captchaPublicKey,
216217 onChangeCaptchaProvider,
217- onReset
218+ onReset,
219+ loginAttempts
218220 } ) => {
219221 return (
220222 < >
@@ -263,6 +265,7 @@ const OTPInputForm = ({
263265 < input type = "hidden" value = "otp" id = "flow" name = "flow" />
264266 < input type = "hidden" value = { otpCode } id = "password" name = "password" />
265267 < input type = "hidden" value = "email" id = "connection" name = "connection" />
268+ < input type = "hidden" value = { loginAttempts ?? 0 } name = "login_attempts" />
266269 { shouldShowCaptcha ( ) && captchaPublicKey &&
267270 < Turnstile
268271 className = { styles . turnstile }
@@ -725,6 +728,15 @@ class LoginPage extends React.Component {
725728 } ) ;
726729 } ;
727730
731+ componentDidUpdate ( prevProps , prevState ) {
732+ if ( this . state . user_verified && this . existingUserCanContinue ( ) && prevState . authFlow !== this . state . authFlow ) {
733+ this . setState ( {
734+ ...this . state ,
735+ captcha_value : '' ,
736+ } ) ;
737+ }
738+ }
739+
728740 render ( ) {
729741 return (
730742 < Container component = "main" maxWidth = "xs" className = { styles . main_container } >
@@ -861,6 +873,7 @@ class LoginPage extends React.Component {
861873 captchaPublicKey = { this . props . captchaPublicKey }
862874 onChangeCaptchaProvider = { this . onChangeCaptchaProvider }
863875 onReset = { this . handleDelete }
876+ loginAttempts = { this . props ?. loginAttempts }
864877 />
865878 < OTPHelpLinks emitOtpAction = { this . handleEmitOtpAction } />
866879 </ >
0 commit comments