mirror of
https://github.com/RocketChat/Rocket.Chat.git
synced 2025-12-28 06:47:25 +00:00
chore!: remove deprecated sendConfirmationEmail method (#36829)
This commit is contained in:
parent
18db8dd58c
commit
04d24848bd
6
.changeset/beige-seahorses-reply.md
Normal file
6
.changeset/beige-seahorses-reply.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
"@rocket.chat/meteor": major
|
||||
"@rocket.chat/web-ui-registration": major
|
||||
---
|
||||
|
||||
Removes the deprecated sendConfirmationEmail method
|
||||
@ -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',
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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'),
|
||||
});
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user