Skip to content

Commit

Permalink
Add recaptcha to ChangePasswordModal
Browse files Browse the repository at this point in the history
  • Loading branch information
Flole998 authored Mar 7, 2024
1 parent ab7eb4a commit bffc878
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/src/forum/extendAuthModals.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
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';

import RecaptchaState from '../common/states/RecaptchaState';
import Recaptcha from '../common/components/Recaptcha';

export const addRecaptchaToAuthModal = <T extends typeof ForgotPasswordModal | typeof LogInModal | typeof SignUpModal>({
export const addRecaptchaToAuthModal = <T extends typeof ForgotPasswordModal | typeof ChangePasswordModal | typeof LogInModal | typeof SignUpModal>({
modal,
type,
dataMethod,
Expand Down Expand Up @@ -83,6 +84,7 @@ export const addRecaptchaToAuthModal = <T extends typeof ForgotPasswordModal | t

export default () => {
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' });
};

0 comments on commit bffc878

Please sign in to comment.