don't print anything if email send is successful
This commit is contained in:
parent
6131db986f
commit
a78e13073f
@ -37,8 +37,7 @@ router.post(
|
|||||||
}
|
}
|
||||||
|
|
||||||
await Email.sendVerificationEmail(user, user.email)
|
await Email.sendVerificationEmail(user, user.email)
|
||||||
.then((info) => {
|
.then(() => {
|
||||||
console.log("Message sent: %s", info.messageId);
|
|
||||||
return res.sendStatus(204);
|
return res.sendStatus(204);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { Request } from "express";
|
||||||
import {
|
import {
|
||||||
Column,
|
Column,
|
||||||
Entity,
|
Entity,
|
||||||
@ -24,23 +25,22 @@ import {
|
|||||||
OneToMany,
|
OneToMany,
|
||||||
OneToOne,
|
OneToOne,
|
||||||
} from "typeorm";
|
} 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 {
|
import {
|
||||||
|
adjustEmail,
|
||||||
Config,
|
Config,
|
||||||
|
Email,
|
||||||
FieldErrors,
|
FieldErrors,
|
||||||
Snowflake,
|
Snowflake,
|
||||||
trimSpecial,
|
trimSpecial,
|
||||||
adjustEmail,
|
|
||||||
Email,
|
|
||||||
} from "..";
|
} 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 { SecurityKey } from "./SecurityKey";
|
||||||
|
import { Session } from "./Session";
|
||||||
|
import { UserSettings } from "./UserSettings";
|
||||||
|
|
||||||
export enum PublicUserEnum {
|
export enum PublicUserEnum {
|
||||||
username,
|
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
|
// send verification email if users aren't verified by default and we have an email
|
||||||
if (!Config.get().defaults.user.verified && email) {
|
if (!Config.get().defaults.user.verified && email) {
|
||||||
await Email.sendVerificationEmail(user, email)
|
await Email.sendVerificationEmail(user, email).catch((e) => {
|
||||||
.then((info) => {
|
console.error(
|
||||||
console.log("Message sent: %s", info.messageId);
|
`Failed to send verification email to ${user.username}#${user.discriminator}: ${e}`,
|
||||||
})
|
);
|
||||||
.catch((e) => {
|
});
|
||||||
console.error(
|
|
||||||
`Failed to send verification email to ${user.username}#${user.discriminator}: ${e}`,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setImmediate(async () => {
|
setImmediate(async () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user