Created the generateAvatarUrl method in the account.ts controller

This commit is contained in:
Mathias Wagner 2023-07-25 21:55:26 +02:00
parent 54fa7499e2
commit 5f6d41f4b7
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -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({