diff --git a/src/controller/account.ts b/src/controller/account.ts index bd678cf..a2b34fd 100644 --- a/src/controller/account.ts +++ b/src/controller/account.ts @@ -3,6 +3,12 @@ import { genSalt, hash } from "bcrypt"; import { sendMail } from "@utils/email"; import { ObjectId, Types } from "mongoose"; import { encryptClearField } from "@utils/decryption"; +import {Md5} from "ts-md5"; + +export const generateAvatarUrl = (email: string) => { + const hash = Md5.hashStr(email.trim().toLowerCase()); + return `https://www.gravatar.com/avatar/${hash}?d=mp`; +} export const sendVerificationEmail = async (email: string, code: number, id: string) => { sendMail({