The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/startup/accounts.ts

18 lines
617 B

import { Accounts } from 'meteor/accounts-base';
import { Meteor } from 'meteor/meteor';
import { sdk } from '../../app/utils/client/lib/SDKClient';
import { t } from '../../app/utils/lib/i18n';
import { dispatchToastMessage } from '../lib/toast';
Accounts.onEmailVerificationLink((token: string) => {
Accounts.verifyEmail(token, (error) => {
if (error instanceof Meteor.Error && error.error === 'verify-email') {
dispatchToastMessage({ type: 'success', message: t('Email_verified') });
void sdk.call('afterVerifyEmail');
return;
}
dispatchToastMessage({ type: 'error', message: error });
});
});