mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-08 06:48:04 +03:00
fix: clear out previous email code on email change
This commit is contained in:
@@ -407,6 +407,11 @@ router.post(
|
||||
if (ServerConfig.EMAIL_CONFIG) {
|
||||
const resetEmailCode = Random20Hex();
|
||||
|
||||
// clear out the previous email code!
|
||||
await db["verify-email-codes"].remove({
|
||||
userID: user.id,
|
||||
});
|
||||
|
||||
await db["verify-email-codes"].insert({
|
||||
code: resetEmailCode,
|
||||
userID: user.id,
|
||||
|
||||
Reference in New Issue
Block a user