Created the generateAvatarUrl method in the account.ts controller
This commit is contained in:
parent
54fa7499e2
commit
5f6d41f4b7
@ -3,6 +3,12 @@ import { genSalt, hash } from "bcrypt";
|
|||||||
import { sendMail } from "@utils/email";
|
import { sendMail } from "@utils/email";
|
||||||
import { ObjectId, Types } from "mongoose";
|
import { ObjectId, Types } from "mongoose";
|
||||||
import { encryptClearField } from "@utils/decryption";
|
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) => {
|
export const sendVerificationEmail = async (email: string, code: number, id: string) => {
|
||||||
sendMail({
|
sendMail({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user