Fix email

This commit is contained in:
split / May 2023-08-04 02:03:54 +00:00
parent 99a0800128
commit 99bdc5fcef

View file

@ -246,7 +246,7 @@ authRoutes.post("/change_username", requiresAccount, parser, (req,res) => {
let verificationCodes = new Map<string, {code: string, email: string, expiry: NodeJS.Timeout, requestedAt:number}>() let verificationCodes = new Map<string, {code: string, email: string, expiry: NodeJS.Timeout, requestedAt:number}>()
authRoutes.post("/request_email_change", requiresAccount, (req,res) => { authRoutes.post("/request_email_change", requiresAccount, parser, (req,res) => {
let acc = res.locals.acc as Accounts.Account let acc = res.locals.acc as Accounts.Account
@ -287,7 +287,6 @@ authRoutes.post("/request_email_change", requiresAccount, (req,res) => {
let e = verificationCodes.get(acc?.id||"")?.expiry let e = verificationCodes.get(acc?.id||"")?.expiry
if (e) clearTimeout(e) if (e) clearTimeout(e)
verificationCodes.delete(acc?.id||"") verificationCodes.delete(acc?.id||"")
console.error(err?.toString())
ServeError(res, 500, err?.toString()) ServeError(res, 500, err?.toString())
}) })
}) })