chore!: remove deprecated sendConfirmationEmail method (#36829)

This commit is contained in:
Martin Schoeler 2025-08-28 18:00:19 -03:00 committed by Guilherme Gazzo
parent 18db8dd58c
commit 04d24848bd
4 changed files with 9 additions and 14 deletions

View File

@ -0,0 +1,6 @@
---
"@rocket.chat/meteor": major
"@rocket.chat/web-ui-registration": major
---
Removes the deprecated sendConfirmationEmail method

View File

@ -1,12 +1,9 @@
import type { ServerMethods } from '@rocket.chat/ddp-client';
import { Users } from '@rocket.chat/models';
import { Accounts } from 'meteor/accounts-base';
import { check } from 'meteor/check';
import { DDPRateLimiter } from 'meteor/ddp-rate-limiter';
import { Meteor } from 'meteor/meteor';
import { methodDeprecationLogger } from '../../app/lib/server/lib/deprecationWarningLogger';
export const sendConfirmationEmail = async (to: string): Promise<boolean> => {
check(to, String);
@ -29,14 +26,6 @@ export const sendConfirmationEmail = async (to: string): Promise<boolean> => {
}
};
Meteor.methods<ServerMethods>({
async sendConfirmationEmail(to) {
methodDeprecationLogger.method('sendConfirmationEmail', '7.0.0', '/v1/users.sendConfirmationEmail');
return sendConfirmationEmail(to);
},
});
DDPRateLimiter.addRule(
{
type: 'method',

View File

@ -32,7 +32,7 @@ export const EmailConfirmationForm = ({ email, onBackToLogin }: { email?: string
if (sendEmail.isPending) {
return;
}
sendEmail.mutate(data.email);
sendEmail.mutate({ email: data.email });
})}
>
<Form.Header>

View File

@ -1,8 +1,8 @@
import { useMethod } from '@rocket.chat/ui-contexts';
import { useEndpoint } from '@rocket.chat/ui-contexts';
import { useMutation } from '@tanstack/react-query';
export const useLoginSendEmailConfirmation = () => {
return useMutation({
mutationFn: useMethod('sendConfirmationEmail'),
mutationFn: useEndpoint('POST', '/v1/users.sendConfirmationEmail'),
});
};