mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-31 19:59:31 -05:00
feat: migrate to validator from email-validator (#2059)
* refactor(adds package): this adds the validator package and removes email-validator from dependencys * refactor(auth.ts and email.ts): migrates from EmailValidator to validator
This commit is contained in:
@@ -7,8 +7,8 @@ import type { NotificationAgentEmail } from '@server/lib/settings';
|
||||
import { getSettings, NotificationAgentKey } from '@server/lib/settings';
|
||||
import logger from '@server/logger';
|
||||
import type { EmailOptions } from 'email-templates';
|
||||
import * as EmailValidator from 'email-validator';
|
||||
import path from 'path';
|
||||
import validator from 'validator';
|
||||
import { Notification, shouldSendAdminNotification } from '..';
|
||||
import type { NotificationAgent, NotificationPayload } from './agent';
|
||||
import { BaseAgent } from './agent';
|
||||
@@ -221,7 +221,7 @@ class EmailAgent
|
||||
this.getSettings(),
|
||||
payload.notifyUser.settings?.pgpKey
|
||||
);
|
||||
if (EmailValidator.validate(payload.notifyUser.email)) {
|
||||
if (validator.isEmail(payload.notifyUser.email)) {
|
||||
await email.send(
|
||||
this.buildMessage(
|
||||
type,
|
||||
@@ -283,7 +283,7 @@ class EmailAgent
|
||||
this.getSettings(),
|
||||
user.settings?.pgpKey
|
||||
);
|
||||
if (EmailValidator.validate(user.email)) {
|
||||
if (validator.isEmail(user.email)) {
|
||||
await email.send(
|
||||
this.buildMessage(type, payload, user.email, user.displayName)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user