summary refs log tree commit diff
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@protonmail.com>2023-02-24 00:10:50 -0500
committerPuyodead1 <puyodead@protonmail.com>2023-02-24 00:10:50 -0500
commita78e13073f2fb070e15067d5fcc67797d890bc7e (patch)
tree32b2bcd233c045d0fd2103c4c6ed245127aab363
parentuse a fixed mailjet transport (diff)
downloadserver-a78e13073f2fb070e15067d5fcc67797d890bc7e.tar.xz
don't print anything if email send is successful
-rw-r--r--src/api/routes/auth/verify/resend.ts3
-rw-r--r--src/util/entities/User.ts34
2 files changed, 16 insertions, 21 deletions
diff --git a/src/api/routes/auth/verify/resend.ts b/src/api/routes/auth/verify/resend.ts
index d54ddf73..1cd14f23 100644
--- a/src/api/routes/auth/verify/resend.ts
+++ b/src/api/routes/auth/verify/resend.ts
@@ -37,8 +37,7 @@ router.post(
 		}
 
 		await Email.sendVerificationEmail(user, user.email)
-			.then((info) => {
-				console.log("Message sent: %s", info.messageId);
+			.then(() => {
 				return res.sendStatus(204);
 			})
 			.catch((e) => {
diff --git a/src/util/entities/User.ts b/src/util/entities/User.ts
index 42f74fb4..2947b205 100644
--- a/src/util/entities/User.ts
+++ b/src/util/entities/User.ts
@@ -16,6 +16,7 @@
 	along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
+import { Request } from "express";
 import {
 	Column,
 	Entity,
@@ -24,23 +25,22 @@ import {
 	OneToMany,
 	OneToOne,
 } from "typeorm";
-import { BaseClass } from "./BaseClass";
-import { BitField } from "../util/BitField";
-import { Relationship } from "./Relationship";
-import { ConnectedAccount } from "./ConnectedAccount";
-import { Member } from "./Member";
-import { UserSettings } from "./UserSettings";
-import { Session } from "./Session";
 import {
+	adjustEmail,
 	Config,
+	Email,
 	FieldErrors,
 	Snowflake,
 	trimSpecial,
-	adjustEmail,
-	Email,
 } from "..";
-import { Request } from "express";
+import { BitField } from "../util/BitField";
+import { BaseClass } from "./BaseClass";
+import { ConnectedAccount } from "./ConnectedAccount";
+import { Member } from "./Member";
+import { Relationship } from "./Relationship";
 import { SecurityKey } from "./SecurityKey";
+import { Session } from "./Session";
+import { UserSettings } from "./UserSettings";
 
 export enum PublicUserEnum {
 	username,
@@ -393,15 +393,11 @@ export class User extends BaseClass {
 
 		// send verification email if users aren't verified by default and we have an email
 		if (!Config.get().defaults.user.verified && email) {
-			await Email.sendVerificationEmail(user, email)
-				.then((info) => {
-					console.log("Message sent: %s", info.messageId);
-				})
-				.catch((e) => {
-					console.error(
-						`Failed to send verification email to ${user.username}#${user.discriminator}: ${e}`,
-					);
-				});
+			await Email.sendVerificationEmail(user, email).catch((e) => {
+				console.error(
+					`Failed to send verification email to ${user.username}#${user.discriminator}: ${e}`,
+				);
+			});
 		}
 
 		setImmediate(async () => {