From bffc878e4f9d164ee031470449e6b5d19180ce6e Mon Sep 17 00:00:00 2001 From: Flole998 Date: Thu, 7 Mar 2024 03:27:19 +0100 Subject: [PATCH] Add recaptcha to ChangePasswordModal Fixes: #50 --- js/src/forum/extendAuthModals.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/src/forum/extendAuthModals.tsx b/js/src/forum/extendAuthModals.tsx index fd2c9ff..97f482e 100644 --- a/js/src/forum/extendAuthModals.tsx +++ b/js/src/forum/extendAuthModals.tsx @@ -1,5 +1,6 @@ import app from 'flarum/forum/app'; import ForgotPasswordModal from 'flarum/forum/components/ForgotPasswordModal'; +import ChangePasswordModal from 'flarum/forum/components/ChangePasswordModal'; import LogInModal from 'flarum/forum/components/LogInModal'; import SignUpModal from 'flarum/forum/components/SignUpModal'; import { extend, override } from 'flarum/common/extend'; @@ -7,7 +8,7 @@ import { extend, override } from 'flarum/common/extend'; import RecaptchaState from '../common/states/RecaptchaState'; import Recaptcha from '../common/components/Recaptcha'; -export const addRecaptchaToAuthModal = ({ +export const addRecaptchaToAuthModal = ({ modal, type, dataMethod, @@ -83,6 +84,7 @@ export const addRecaptchaToAuthModal = { addRecaptchaToAuthModal({ modal: ForgotPasswordModal, type: 'forgot', dataMethod: 'requestParams' }); + addRecaptchaToAuthModal({ modal: ChangePasswordModal, type: 'forgot', dataMethod: 'requestBody' }); addRecaptchaToAuthModal({ modal: LogInModal, type: 'signin', dataMethod: 'loginParams' }); addRecaptchaToAuthModal({ modal: SignUpModal, type: 'signup', dataMethod: 'submitData' }); };